plebeia
-
plebeia
-
-
plebeia.msync
-
plebeia.test_utils
-
Library
Module
Module type
Parameter
Class
Class type
include module type of struct include Node_type end
2 Types
type hashed =
| Hashed of Hash.Prefix.t | |
| Not_Hashed | (* Type used to prove that if a node is hashed then so are its children. The type also provides the hash as a witness. *) |
type indexed =
| Indexed of Index.t | |
| Not_Indexed | (* This rule expresses the following invariant : if a node is indexed, then its children are necessarily indexed. Less trivially, if an internal node is not indexed then at least one of its children is not yet indexed. The reason is that we never construct new nodes that just point to only existing nodes. This property guarantees that when we write internal nodes on disk, at least one of the child can be written adjacent to its parent. *) |
and view = private
| Internal of node * node * indexed * hashed |
| Bud of node option * indexed * hashed |
| Leaf of Value.t * indexed * hashed |
| Extender of Segment.t * node * indexed * hashed |
view constructors are private. Use _Internal, _Bud, _Leaf, and _Extender functions with runtime invariant checks.
type t = node
2 Constructors with invariant checks
2 Accessors
val indexed : node -> bool
val hashed : node -> bool
val hash_available : node -> bool
val hash_prefix_of_view : view -> Hash.Prefix.t option
2 Tools to create Not_Indexed and Not_Hashed nodes
2 Loading of nodes
2 Debug
val pp : Stdlib.Format.formatter -> node -> unit
Pretty printer
2 Mapper
module Mapper : sig ... end
Mapper over a node
module Fold : sig ... end
Fold over a node
module Fold' : sig ... end
Fold over a node
Random generators
gen_bud depth
is a generator of Internal node with about depth
sides
val read_node :
Context.t ->
Index.t ->
Node_type.extender_witness ->
Node_type.view
Node reading from a context
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.
val compute_hash : Context.t -> Node_type.node -> Node_type.node * Hash.t
Compute the hash of the node with its view