package irmin-git

  1. Overview
  2. Docs
On This Page
  1. Sets and Maps.
Git backend for Irmin

Install

dune-project
 Dependency

Authors

Maintainers

Sources

irmin-3.10.0.tbz
sha256=92a9de7a0a2a35c2feba0c35a806b1f0df24c1c0d15164eebf3f919296d26715
sha512=0203ec5117a851ad5afeb2f9091659b4e142e231b6b945caab93f4d7beb23397c8ac43f7056e91d18f4bff0be1062f6ae966d221f877c229328c0cbbf29fd9f0

doc/irmin-git.unix/Irmin_git_unix/Maker/argument-1-G/Value/Blob/index.html

Module Value.Blob

type hash = hash
type nonrec t = Git.Blob.t
val digest : t -> hash

digest t associates a hash to any value of t. It is guaranteed that if x = y or compare x y = 0, then digest x = digest y.

val pp : t Fmt.t

Pretty-printer of t.

val compare : t -> t -> int

The comparison function for t.

val hash : t -> int

hash blob associates a non-negative integer to any value of t. It is guaranteed that if x = y or compare x y = 0, then hash x = hash y.

val equal : t -> t -> bool

The equal function for t.

Sets and Maps.

module Set : Set.S with type elt = t
module Map : Map.S with type key = t
val length : t -> int64
val of_cstruct : Cstruct.t -> t

of_cstruct cs is the blob from the given Cstruct.t cs. This function does not take the ownership on cs.

Note. If the user set the given cs, it updates the blob too. This function does not copy the given Cstruct.t.

  let cs = Cstruct.of_string "Hello" in
  let blob = Blob.of_cstruct cs in
  Blob.digest blob ;;
  - : hash = 5ab2f8a4323abafb10abb68657d9d39f1a775057
  Cstruct.set_char cs 0 'V' ;;
  - : unit = ()
  Blob.digest blob ;;
  - : hash = 4081c40614b490bea69ea2ed8fdfdb86f04b5579
val to_cstruct : t -> Cstruct.t

to_cstruct blob is the Cstruct.t from the given blob. This function does not create a fresh Cstruct.t,

val of_string : string -> t

of_string str is the blob from the given string str.

Note. Despite of_cstruct, of_string does a copy of the given string.

val to_string : t -> string

to_string blob is the string from the given blob.