Legend:
Library
Module
Module type
Parameter
Class
Class type
The functor to make the lazy decoder of the IDX file. Internally, we use a Cstruct.t representation of the IDX file notified to the make function. This Cstruct.t should never change by the client. All processes available in this module read only the content.
By lazy, we mean that we don't try to make an OCaml value which contains all binded values available in the IDX file - and, by this way, we don't process entirely the file. We read values only when the client ask to get these values - call by need. Use this decoder with the syscallmmap to get the expected Cstruct.t could be useful when mmap do a lazy read.
val make : ?cache:int ->Cstruct.t ->(t, error)Stdlib.result
Make a new state from a Cstruct.t buffer. You can specify how many elements we can store to the cache. This function returns the state t or an error.
Indeed, in this function we check if the IDX file stored entirely on the Cstruct.t is well-formed. Otherwise, we return an explicit error.
val find : t->Hash.t->(Checkseum.Crc32.t * int64) option
find t hash get the CRC-32 checksum and the absolute offset binded on hash in the IDX file represented by t only if hash exists. Otherwise, it returns None.