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.11.0.tbz
sha256=09996fbcc2c43e117a9bd8e9028c635e81cccb264d5e02d425ab8b06bbacdbdb
sha512=0391a6bf7b94a1edd50a3a8df9e58961739fa78d7d689d61f56bc87144483bad2ee539df595c33d9d52c29b3458da5dddf3a73b5eb85e49c4667c26d2cd46be1

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

Module Value.Tree

type hash = hash
type nonrec entry = hash Git.Tree.entry
type nonrec t = hash Git.Tree.t
val entry : name:string -> Git.Tree.perm -> hash -> entry

entry ~name perm node is the entry to node with the name name and the mode perm.

val v : entry list -> t

v entries ties all entries into one tree object. It does not remove duplicate but re-order the given list such as:

  Tree.digest (Tree.v [ { name= a; _ }; { name= b; _ }] ) ;;
  - : hash = 8d14531846b95bfa3564b58ccfb7913a034323b8
  Tree.digest (Tree.v [ { name= b; _ }; { name= a; _ }] ) ;;
  - : hash = 8d14531846b95bfa3564b58ccfb7913a034323b8
val add : entry -> t -> t

add entry tree returns a tree containing all elements of tree, plus entry. If entry was already in tree, tree is unchanged.

val remove : name:string -> t -> t

remove ~name tree returns a tree containing all elements of tree, except one with the name name. If any entries of the given tree don't have the name name, tree is returned unchanged.

val is_empty : t -> bool

is_empty tree tests whether the given tree is empty or not.

val format : t Encore.t

format is a description of how to encode/decode a t object.

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

length tree is the length of the given tree object.

val hashes : t -> hash list

hashes tree returns the list of all node references of the given tree.

val to_list : t -> entry list

to_list tree returns the list of all entries of the given tree.

val of_list : entry list -> t

Same as v.

val iter : (entry -> unit) -> t -> unit

iter f tree applies f in turn to all elements of s.