plebeia

Merkle Patricia tree implementation
Library plebeia
Module Plebeia . Internal . Context

2 Types

type t = {
storage : Plebeia__Storage.storage;
hashcons : Hashcons.t;
stat : Stat.t;
}
val create : ?pos:int64 -> ?length:int -> ?hashcons:Hashcons.config -> string -> t

Create a new context storage. Note that if the file already exists, create fails.

The context is created in Writer mode.

pos: the start position in the file length: initial size of the file in bytes

val open_ : ?pos:int64 -> ?hashcons:Hashcons.config -> mode:Plebeia__Storage.mode -> string -> t

Open an existing context storage.

pos: The start position in the file

val close : t -> unit

Closes the context.

If program exits or crashes without closing a context, some data may be lost, even if they are written on the disk.

val mode : t -> Plebeia__Storage.mode

Returns writing mode

val ref_load_leaf_value : ( t -> Plebeia__Index.t -> Value.t option ) ref

Forward declaration to load a leaf value from context