package tezos-protocol-004-Pt24m4xi
type context = t
val mem :
context ->
Raw_context.key ->
bool Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Tells if the key is already defined as a value.
val dir_mem :
context ->
Raw_context.key ->
bool Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Tells if the key is already defined as a directory.
val get :
context ->
Raw_context.key ->
Raw_context.value
Tezos_protocol_environment_004_Pt24m4xi.Error_monad.tzresult
Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Retrieve the value from the storage bucket ; returns a Storage_errorMissing_key
if the key is not set.
val get_option :
context ->
Raw_context.key ->
Raw_context.value option Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Retrieves the value from the storage bucket ; returns None
if the data is not initialized.
val init :
context ->
Raw_context.key ->
Raw_context.value ->
context Tezos_protocol_environment_004_Pt24m4xi.Error_monad.tzresult
Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Allocates the storage bucket and initializes it ; returns a Storage_errorExisting_key
if the bucket exists.
val set :
context ->
Raw_context.key ->
Raw_context.value ->
context Tezos_protocol_environment_004_Pt24m4xi.Error_monad.tzresult
Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Updates the content of the bucket ; returns a Storage_error
Missing_key
if the value does not exists.
val init_set :
context ->
Raw_context.key ->
Raw_context.value ->
context Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Allocates the data and initializes it with a value ; just updates it if the bucket exists.
val set_option :
context ->
Raw_context.key ->
Raw_context.value option ->
context Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
When the value is Some v
, allocates the data and initializes it with v
; just updates it if the bucket exists. When the valus is None
, delete the storage bucket when the value ; does nothing if the bucket does not exists.
val delete :
context ->
Raw_context.key ->
context Tezos_protocol_environment_004_Pt24m4xi.Error_monad.tzresult
Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Delete the storage bucket ; returns a Storage_error
Missing_key
if the bucket does not exists.
val remove :
context ->
Raw_context.key ->
context Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Removes the storage bucket and its contents ; does nothing if the bucket does not exists.
val remove_rec :
context ->
Raw_context.key ->
context Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Recursively removes all the storage buckets and contents ; does nothing if no bucket exists.
val fold :
context ->
Raw_context.key ->
init:'a ->
f:
([ `Key of Raw_context.key | `Dir of Raw_context.key ] ->
'a ->
'a Tezos_protocol_environment_004_Pt24m4xi.Lwt.t) ->
'a Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Iterator on all the items of a given directory.
val keys :
context ->
Raw_context.key ->
Raw_context.key list Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Recursively list all subkeys of a given key.
val fold_keys :
context ->
Raw_context.key ->
init:'a ->
f:(Raw_context.key -> 'a -> 'a Tezos_protocol_environment_004_Pt24m4xi.Lwt.t) ->
'a Tezos_protocol_environment_004_Pt24m4xi.Lwt.t
Recursive iterator on all the subkeys of a given key.
val project : context -> Raw_context.root_context
Internally used in Storage_functors
to escape from a view.
val absolute_key : context -> Raw_context.key -> Raw_context.key
Internally used in Storage_functors
to retrieve a full key from partial key relative a view.
val consume_gas :
context ->
Gas_limit_repr.cost ->
context Tezos_protocol_environment_004_Pt24m4xi.Error_monad.tzresult
Internally used in Storage_functors
to consume gas from within a view.
val check_enough_gas :
context ->
Gas_limit_repr.cost ->
unit Tezos_protocol_environment_004_Pt24m4xi.Error_monad.tzresult
Check if consume_gas will fail
val description : context Storage_description.t