Mavryk_raw_protocol_001_PtAtLas.Storage_description
This module is responsible for building the description of the current state of the storage, which is then used to build specification of the RPC endpoints for accessing the storage. It produces resto
RPC_directory.t
values, which can be used directly to construct the RPC endpoint tree.
val pp :
Mavryk_protocol_environment_001_PtAtLas.Format.formatter ->
'key t ->
unit
Trivial display of the key-value context layout.
val build_directory :
'key t ->
'key Mavryk_protocol_environment_001_PtAtLas.RPC_directory.t
Export an RPC hierarchy for querying the context. There is one service by possible path in the context. Services for "directory" are able to aggregate in one JSON object the whole subtree.
val create : unit -> 'key t
Create a empty context description, keys will be registered by side effects.
val register_value :
'key t ->
get:
('key ->
'a option Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t) ->
'a Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t ->
unit
Register a single key accessor at a given path.
Return a description for a prefixed fragment of the given context. All keys registered in the subcontext will be shared by the external context
type (_, _, _) args =
| One : {
rpc_arg : 'a Mavryk_protocol_environment_001_PtAtLas.RPC_arg.t;
encoding : 'a Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t;
compare : 'a -> 'a -> int;
} -> ('key, 'a, 'key * 'a) args
| Pair : ('key, 'a, 'inter_key) args
* ('inter_key, 'b, 'sub_key) args -> ('key, 'a * 'b, 'sub_key) args
Description of an index as a sequence of `RPC_arg.t`.
val register_indexed_subcontext :
'key t ->
list:
('key ->
'arg list Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t) ->
('key, 'arg, 'sub_key) args ->
'sub_key t
Return a description for a indexed sub-context. All keys registered in the subcontext will be shared by the external context. One should provide a function to list all the registered index in the context.
Helpers for manipulating and defining indexes.
val pack : ('key, 'a, 'sub_key) args -> 'key -> 'a -> 'sub_key
val unpack : ('key, 'a, 'sub_key) args -> 'sub_key -> 'key * 'a
module type INDEX = sig ... end