module Hash : sig ... end
module Inflate : sig ... end
module Deflate : sig ... end
module Value : S with module Hash := Hash and module Inflate := Inflate and module Deflate := Deflate
include module type of Value
type t =
| Blob of Blob.t | The |
| Commit of Commit.t | The |
| Tree of Tree.t | The |
| Tag of Tag.t | The |
OCaml value which represents a Git object.
val kind : t -> [ `Commit | `Blob | `Tree | `Tag ]
kind o
returns the kind of the Git object.
val pp_kind : [ `Commit | `Blob | `Tree | `Tag ] Fmt.t
pp_kind ppf kind
is a human readable pretty-printer of kind
.
module MakeMeta : functor (Meta : Encore.Meta.S) -> sig ... end
module A : sig ... end
module M : sig ... end
module D : sig ... end
module E : sig ... end
val length : t -> int64
module EncoderRaw : sig ... end
module DecoderRaw : sig ... end
module EncoderWithoutHeader : sig ... end
val to_deflated_raw : raw:Cstruct.t -> etmp:Cstruct.t -> ?level:int -> ztmp:Cstruct.t -> t -> (string, E.error) Stdlib.result
to_deflated_raw ?capacity ?level ~ztmp value
serializes and deflates the value value
. capacity
is the memory consumption of the encoder in bytes (default to 0x100
), level
is the level of the compression (default to 4
) and ztmp
is an internal buffer used to store the serialized value before the deflation.
All error from the Deflate
module is relayed to the `Deflate
error value.
val to_raw : raw:Cstruct.t -> etmp:Cstruct.t -> t -> (string, EncoderRaw.error) Stdlib.result
to_raw ?capacity value
serializes the value value
. capacity
is the memory consumption of the encoder in bytes (default to 0x100
).
This function can not returns an EE
.error (see EE
).
val to_raw_without_header : raw:Cstruct.t -> etmp:Cstruct.t -> t -> (string, EncoderWithoutHeader.error) Stdlib.result
val of_raw : kind:[ `Commit | `Blob | `Tree | `Tag ] -> Cstruct.t -> (t, Error.Decoder.t) Stdlib.result
of_raw ~kind inflated
makes a Git object as an OCaml value t
. This decoder does not expect an header to recognize which kind of Git object is it. That means the inflated
raw should not contain kind
size\000
at the beginning (in this case, you should use of_raw_with_header
.
val of_raw_with_header : Cstruct.t -> (t, DecoderRaw.error) Stdlib.result
of_raw_with_header inflated
makes a Git object as an OCaml value t
. This decoder expects an header to choose which Git object it is.