type error = The type error.
type t = {i_off : int; |
i_pos : int; |
i_len : int; |
read : int; |
_length : int; |
_reference : reference; |
_source_length : int; |
_target_length : int; |
_hunk : hunk option; |
_tmp : Cstruct.t; |
state : state; |
}The type of the Hunk decoder.
and state = | Header of k |
| Stop |
| List of k |
| Is_insert of Cstruct.t * int * int |
| Is_copy of k |
| End |
| Exception of error |
and res = | Wait of t | |
| Error of t * error | |
| Cont of t | |
| Ok of t * hunks | The type of compressed/delta-ified object. |
The type of the reference. It's a negative offset or the hash of the source object.
and hunks = {reference : reference; | Reference to the source. |
length : int; | Inflated length of the serialized Hunk. |
source_length : int; | Length of the source object. |
target_length : int; | Expected length of the target object. |
}partial_hunks t returns a partial hunks to get some available information. hunks.hunks is not available.
val eval : Cstruct.t -> t -> [ `Hunk of t * hunk | `Await of t | `Error of t * error | `Ok of t * hunks ]eval src t is:
`Await tifftneeds more input storage. The client must userefillto provide a new buffer and then callevalwith`Awaituntil other value returned.`Hunk twhentcan return a newhunk. The client can callcontinueto move to the next step of the process, otherwise the decode sticks on this situation. The value will be consumed then. If thehunkisInsert, the internalCstruct.tneed to be copied becauseevalwill erase the content then.`Ok (t, hunks)whentis done. We returns the complete valuehunks. Then,tsticks on this situation, the client can remove it.`Error (t, exn)iff the decodertmeet anerrorexn. The decoder can't continue and sticks in this situation.
refill off len t provides a new t with len bytes to read, starting at off. This byte range is read by calls to eval with t until `Await is returned.
val used_in : t -> intused_in ŧ returns how many byte t consumed in the current buffer noticed to the previous call of eval.
val available_in : t -> intavailable_in t returns how many byte is available in the current buffer noticed to the previous call of eval.
val read : t -> intread t returns how many byte t read at the beginning. The client can assert than read t is equal to length noticed when he make the new decoder.