Legend:
Library
Module
Module type
Parameter
Class
Class type
The functor to make the decoder module by a specific hash implementation. We constraint the Hash.S module to compute a
struct.t
flow. This module is a non-blocking decoder with a pure state of the IDX file. It's better to use this module instead Lazy if the client wants an OCaml representation of the IDX file - he can construct this specific OCaml value step by step with this decoder like a Radix tree.
In the result, if the client construct an efficient data-structure (like a Radix tree) when he decodes the IDX file, the find operation should be more fast than the Lazy.find. However, the Lazy.make operation could be more fast than to decode and to construct an OCaml value.
`Await t iff t needs more input storage. The client must use refill to provide a new buffer and then call eval with `Await until other value returned.
`End (t, hash) when t is done. We returns the hash of the IDX file.
`Hash (t, (hash, crc, offset)) when t can returns a new value (hash, crc, offset). The client can call eval to continue the process. The value will be consumed then.
`Error (t, exn) iff the decoder meet an errorexn. The decoder can't continue and sticks in this situation.