Plebeia.Node_storageSourceval write_node :
?clear:bool ->
Context.t ->
Node_type.node ->
(Node_type.node * Index.t * Hash.Prefix.t * int option, Error.t) resultWrite a node to the storage, and returns the updated version of the node with its index and hash.
If clear=true, then it forgets the details of the given node after the commit and returns a Disk _ node points to the commit.
Note that this function does not update the header. Storage.commit must be called to make the written node persistent.
Read the node at the given index of the context, parse it and create a view node with it.
Note: load_node does not load the hash. Use load_hash_prefix for hashes.
val read_hash :
Context.t ->
Node_type.t ->
[ `Hashed of Hash.t * Node_type.t | `Not_Hashed of Node_type.view ]Read hash if it is not yet
Obtain the view of the node. If the view is not available in the memory, it is loaded from the storage.
Exception: if the node is Hash h, it raises HashOnly h.
Note: view does not load the hash.
Recusively visit and load all the subnodes in memory.
(if reset_index, all the indices are reset to Not_Indexed.)
Note: load_node_fully does not load the hash.
Copy the node from src context to another context dst.
This function assumes src and dst use the same hashing. If their hashings are incompatible, it raises Invalid_argument _.
val internal :
Context.t ->
(Node_type.node * Node_type.node * Node_type.indexed * Node_type.hashed) ->
Node_type.nodeval bud :
Context.t ->
(Node_type.node option * Node_type.indexed * Node_type.hashed) ->
Node_type.nodeval extender :
Context.t ->
(Segment.t * Node_type.node * Node_type.indexed * Node_type.hashed) ->
Node_type.nodecount the leaves and buds, loading nodes on demand.
count_itself ctxt n returns 1 when n is Bud, not the numbers of the leaves and buds under the bud.
Returns None when the pagination count is not in the context.
count the leaves and buds, loading nodes on demand.
count ctxt n, if n is a Bud, returns the number of the leaves and buds under n.
Returns None when the pagination count is not in the context.