Module Brr.File.Read

module Read: sig .. end
Reading files.


Read progress


type progress 
The type for read progress.
val bytes_read : progress -> int
bytes_read p is the number of bytes read so far.
val bytes_total : progress -> int option
bytes_total p is the total number of bytes to read.

File reads


type error = [ `Aborted | `Not_found | `Not_readable | `Other of string | `Security ] 
The type for file read errors.
val pp_error : Format.formatter -> error -> unit
pp_error ppf e prints an unspecified representation of e on ppf.
type file = Brr.File.t 
The type for files.
type 'a t 
The type for file reads returning results of type 'a.
val to_data_url : file -> Brr.str t
to_data_url f reads file f as as a data URL. This doesn't start the read use read.
val abort : 'a t -> unit
abort r aborts the file read r.
val result : 'a t ->
(file * ('a, error) Pervasives.result) Note.event
result r is an event that occurs only once with the read result.
val progress : 'a t ->
(file * progress) Note.event
progress r is an event that occurs during the read of r.