plebeia
-
plebeia
-
-
plebeia.msync
-
plebeia.test_utils
-
Library
Module
Module type
Parameter
Class
Class type
exception ReadFailure of Error.t
val write_node :
?clear:bool ->
Context.t ->
Node_type.node ->
( Node_type.node * Index.t * Hash.Prefix.t, Error.t ) Stdlib.result
Write 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.
val read_node :
Context.t ->
Index.t ->
Node_type.extender_witness ->
Node_type.view
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
exception HashOnly of Hash.t
val view : Context.t -> Node_type.node -> Node_type.view
Obtain the view of the node. If the view is not available in the memory, it is loaded from the storage.
If the node is Hash h
, it raises HashOnly h
.
Note: view
does not load the hash.
val read_node_fully :
reset_index:bool ->
Context.t ->
Node_type.node ->
Node_type.node
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.
val change_context :
src:Context.t ->
dst:Context.t ->
Node_type.node ->
Node_type.node
Copy the node from src
context to another context dst
val leaf :
Context.t ->
(Value.t * Node_type.indexed * Node_type.hashed) ->
Node_type.node
val internal :
Context.t ->
(Node_type.node * Node_type.node * Node_type.indexed * Node_type.hashed) ->
Node_type.node
val bud :
Context.t ->
(Node_type.node option * Node_type.indexed * Node_type.hashed) ->
Node_type.node
val extender :
Context.t ->
(Segment.t * Node_type.node * Node_type.indexed * Node_type.hashed) ->
Node_type.node
module Internal : sig ... end