module Hash : sig ... endmodule Deflate : sig ... endThe Map tree zhich zill represent the IDX file of the PACK stream.
type error = | Deflate_error of Deflate.error | Appears when the deflate algorithm raises an error. |
| Invalid_hash of Hash.t | Appears when the hash requested does not exist. |
The type error.
val used_out : t -> intused_out ŧ returns how many byte t wrote in the current buffer noticed to the previous call of eval.
val used_in : t -> intused_in ŧ returns how many byte t consumed in the current buffer noticed to the previous call of eval.
flush off len t provides t with len bytes to write, starting at off. This byte range is written by calls to eval with t until `Flush is returned.
finish t provides a new t which terminate to serialize the current Git object. The next call of eval should not return an `Await value unless the output space is enough to start to serialize the next entry.
expect t returns the object expected to the serialization. At this time, the serializer requests the inflated raw of this git object. The client is able to use it only when eval return `Await. The encoder does not wqnt the ownership of the inflated raw, it access on it only as a read-only flow (that means, the src Cstruct.t could be physicaly the same.
val idx : t -> (Checkseum.Crc32.t * int64) Hash.Map.tidx t returns a Map tree which contains the CRC-32 checksum and the absolute offset for each Git object serialized. The client is able to use it only when eval returns `End.
Make a new encoder t of the PACK stream.
tmp is a Cstruct.t used as an internal output of the Hunk Encoder H. We let the user to allocate the optimized length for this temporary buffer and we take the ownership (so, you don't use it to another computer).
Then, the client need to notice the ordered list of what he wants to serialize.
val eval : Cstruct.t -> Cstruct.t -> t -> [ `Flush of t | `Await of t | `End of t * Hash.t | `Error of t * error ]eval src t is:
`Await tifftneeds more input storage. The client must userefillto provide a new buffer and then callevalwith`Awaituntil other value returned.`Flush tifftneeds more output storage. The client must useflushto provide a new buffer and then callevalwith`Flushuntil other value returned.`End (t, hash)whentis done. Then,tsticks on this situation, the client can remove it.hashis the hash calculated of the PACK stream.`Error (t, exn)iff the encodertmeet anerrorexn. The encoder can't continue and sticks in this situation.