package irmin-pack
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=6aa5ba4c6a0233747d4bd3ab396f2b3a33bb80f9d8ed4a178c83a035033c0e52
sha512=8a5506a57e8569a11c883ca25b3c60ae7a9a03c2da111668193d7b4296434c43f1a310e78f189e4b38c234da790259d2961c6a0ae481282c18bb97f618fccfb6
doc/irmin-pack.unix/Irmin_pack_unix/Dispatcher/Make/index.html
Module Dispatcher.MakeSource
Parameters
module Fm : File_manager.S with module Io = Io.UnixSignature
module Fm = Fmval read_exn :
t ->
off:Optint.Int63.t ->
len:int ->
?volume_identifier:Lower.volume_identifier ->
bytes ->
Lower.volume_identifier optionread_exn t ~off ~len buffer writes into buffer the bytes from off to off+len. If the read occurred, in a lower volume, its identifier is returned.
If you know which volume to read from in the lower, provide volume_identifier to skip checking the prefix.
Note: read_exn is the only read function that supports reading in the lower.
val read_range_exn :
t ->
off:Optint.Int63.t ->
min_len:int ->
max_len:int ->
?volume_identifier:Lower.volume_identifier ->
bytes ->
int * Lower.volume_identifier optionSame as read_exn, the amount read is max_len if possible or at least min_len if reading more would step over a hole in the sparse file. Returns the actually read length and optionnaly the volume where the data was found.
end_offset is the end offsets of the pack entries, counting that the prefix doesn't start at 0. It counts the entries not yet flushed from the prefix.
suffix_start_offset is the offsets of the first pack entry in the suffix. All pack entries in the prefix fit below suffix_start_offset.
offset_of_soff t suffix_off converts a suffix offset into a (global) offset.
soff_of_offset t global_offset converts a global offset to a suffix offset.
val read_seq_exn :
t ->
off:Optint.Int63.t ->
len:Optint.Int63.t ->
string Irmin.Export_for_backends.Seq.tval read_bytes_exn :
t ->
f:(string -> unit) ->
off:Optint.Int63.t ->
len:Optint.Int63.t ->
unitread_bytes_exn reads a slice of the global offset space defined by off and len.
The calls to f ignore the objects boundaries (i.e. the string passed to f will most of the time not be the beginning of an object).
The strings passed to f are safe. They can be kept around, they are not the result of an unsafe_to_string conversion.
The call will fail if the (off, len) range is invalid. It will succeed in these cases:
- If the range designates a slice of the suffix.
- If the range designates a slice of contiguous live bytes in the prefix
- If the range designates a slice of contiguous live bytes that starts in the prefix and ends in the suffix. This implies that the last chunk of the prefix is contiguous to the start of the suffix.
next_valid_offset t ~off returns an offset greater or equal to off that can be read. Used to iterate over the entries while skipping over the holes in the sparse file.