package plebeia

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

3 High level

Functions in this module assumes the given cursor points to a bud.

3 High level

val deep : go_up:bool -> create_subtrees:bool -> Cursor.t -> Segment.t list -> (Cursor.t -> Segment.t -> (Cursor.t * 'a, Error.t) Result.t) -> (Cursor.t * 'a, Error.t) Result.t

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

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

If the target does not exists, do nothing

val delete' : Cursor.t -> Segment.t list -> (Cursor.t, Error.t) Result.t

Delete also internal and extender

val delete_and_clean_empty : Cursor.t -> Segment.t list -> (Cursor.t, 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 delete_and_clean_empty' : Cursor.t -> Segment.t list -> (Cursor.t, 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 original position. If the Bud at the original position becomes empty, the funciton fails.

val create_subtree : create_subtrees:bool -> Cursor.t -> Segment.t list -> (Cursor.t, Error.t) Result.t
val subtree : Cursor.t -> Segment.t list -> (Cursor.t, Error.t) Result.t
val subtree_or_create : create_subtrees:bool -> Cursor.t -> Segment.t list -> (Cursor.t, Error.t) Result.t
val copy : ?allow_overwrite:bool -> create_subtrees:bool -> Cursor.t -> Segment.t list -> Segment.t list -> (Cursor.t, Error.t) Result.t

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

allow_overwrite is false by default

val copy' : ?allow_overwrite:bool -> ?only_bud:bool -> create_subtrees:bool -> copy_ref:Cursor.t -> Cursor.t -> Segment.t list -> Segment.t list -> (Cursor.t, Error.t) Result.t

General version of copy. Copiable non Buds if only_bud=true

allow_overwrite is false by default only_bud is false by default

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.

There is no prevention of cycle creation.

val alter : Cursor.t -> Segment.t list -> (Node_type.view option -> (Node_type.t, Error.t) Stdlib.result) -> (Cursor.t, Error.t) Stdlib.result
OCaml

Innovation. Community. Security.