plebeia

Merkle Patricia tree implementation
Library plebeia
Module Plebeia . Internal . Deep
val deep : go_up:bool -> create_subtrees:bool -> Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor -> Segment.t -> ( Plebeia__Cursor.cursor * 'a, Error.t ) Result.t ) -> ( Plebeia__Cursor.cursor * 'a, Error.t ) Result.t

Multi Bud level interface. deep performs f against the node pointed by the multi segments.

val get : Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor * [ `Bud of Plebeia__Node.view | `Leaf of Plebeia__Node.view ], Error.t ) Result.t
val get_value : Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor * Value.t, Error.t ) Result.t
val insert : Plebeia__Cursor.cursor -> Segment.t list -> Value.t -> ( Plebeia__Cursor.cursor, Error.t ) Result.t
val upsert : Plebeia__Cursor.cursor -> Segment.t list -> Value.t -> ( Plebeia__Cursor.cursor, Error.t ) Result.t
val update : Plebeia__Cursor.cursor -> Segment.t list -> Value.t -> ( Plebeia__Cursor.cursor, Error.t ) Result.t
val delete : Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor, Error.t ) Result.t

If the target does not exists, do nothing

val delete_and_clean_empty : Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor, Error.t ) Result.t

If the target does not exists, do nothing. If the result of the removal generates an empty bud, delete_and_clean_empty also cleans it.

The result cursor points to the bud which has the top most removed element.

val create_subtree : create_subtrees:bool -> Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor, Error.t ) Result.t
val subtree : Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor, Error.t ) Result.t
val subtree_or_create : create_subtrees:bool -> Plebeia__Cursor.cursor -> Segment.t list -> ( Plebeia__Cursor.cursor, Error.t ) Result.t
val copy : create_subtrees:bool -> Plebeia__Cursor.cursor -> Segment.t list -> Segment.t list -> ( Plebeia__Cursor.cursor, Error.t ) Result.t

Subtree copy by making two nodes point to the same subtree.

Copy attempts which introduce loops are rejected.

link n c segs makes a link to n at c/segs.

link is like copy, but n needs not to be a part of the tree of c.

n and c must be of the same context. In addition, they must base on the same commit. Otherwise link can break the invariant of index ordering between commits used by the fast multi-commit node traversal Traverse.

There is no prevention of cycle creation.