package plebeia

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

3 Version control

1 Commit entry

This module defines the data type for the commit entry.

How it is loaded/saved to the disk is defined in Commit_tree and Commit_db.Store.

3 Version control

type t = {
  1. parent : Commit_hash.t option;
  2. index : Index.t;
    (*

    Index of the Plebeia tree root node in storage_context.

    If the commit is a dummy, field index is set to Index.zero.

    *)
  3. hash : Commit_hash.t;
    (*

    Context hash

    *)
  4. info : Index.t;
    (*

    Index of the Info.t in storage_conetxt.

    *)
}
val is_genesis : t -> bool

Returns true if the entry is a genesis: no parent

val pp : Stdlib.Format.formatter -> t -> unit
val compare : t -> t -> int

Comparison by index field

val compute_hash : (module Plebeia__.Hashfunc_intf.S) -> parent:Commit_hash.t option -> Hash.Prefix.t -> Commit_hash.t

Hash computation for a new commit entry

val make : (module Plebeia__.Hashfunc_intf.S) -> parent:Commit_hash.t option -> index:Index.t -> info:Index.t -> ?hash_override:Commit_hash.t -> Hash.Prefix.t -> t

Make a new commit entry.

If hash_override is set, hash of the new entry is overridden by it, instead of computing from parent and the given Hash.Prefix.t.

OCaml

Innovation. Community. Security.