plebeia

Functional storage using Merkle Patricia tree
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library plebeia.test_utils
Module Test_utils . Dumb
type segment = Plebeia.Segment.t
type value = Plebeia.Value.t
type context = unit
type error = string
type t
type cursor
val get_node : cursor -> t
val empty : context -> cursor

Creates a cursor to a new, empty tree.

val subtree : cursor -> segment -> ( cursor, error ) Stdlib.result

Moves the cursor down a segment, to the root of a sub-tree. Think "cd segment/"

val create_subtree : cursor -> segment -> ( cursor, error ) Stdlib.result

Create a subtree (bud). Think "mkdir segment"

val parent : cursor -> ( cursor, error ) Stdlib.result

Moves the cursor back to the parent tree. Think "cd .."

val get_value : cursor -> segment -> ( value, error ) Stdlib.result

Gets a value if present in the current tree at the given segment.

val insert : cursor -> segment -> value -> ( cursor, error ) Stdlib.result

Inserts a value at the given segment in the current tree. Returns the new cursor if successful.

val upsert : cursor -> segment -> value -> ( cursor, error ) Stdlib.result

Upserts. This can still fail if the segment leads to a subtree.

val delete : cursor -> segment -> ( cursor, error ) Stdlib.result

Delete a leaf or subtree.

val of_plebeia_node : Plebeia.Context.t -> Plebeia.Node.node -> t
val dot_of_node : t -> string
val dot_of_cursor : cursor -> string