package plebeia

  1. Overview
  2. Docs

1 Merkle Patricia tree storage

2 Types

type t = {
  1. storage : Plebeia__.Storage.storage;
  2. hashcons : Hashcons.t;
  3. 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) Stdlib.ref

Forward declaration to load a leaf value from context