Storage_sigs.Single_data_storageThe generic signature of a single data accessor (a single value bound to a specific key in the hierarchical (key x value) database).
type context = tval mem : context -> bool Mavryk_protocol_environment_alpha.Lwt.tTells if the data is already defined
val get :
context ->
value Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.tRetrieve the value from the storage bucket ; returns a Storage_error if the key is not set or if the deserialisation fails
val find :
context ->
value option Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.tRetrieves the value from the storage bucket ; returns None if the data is not initialized, or Storage_helpers.Storage_error if the deserialisation fails
val init :
context ->
value ->
Raw_context.t Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.tAllocates the storage bucket and initializes it ; returns a Storage_errorExisting_key if the bucket exists
val update :
context ->
value ->
Raw_context.t Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.tUpdates the content of the bucket ; returns a Storage_Error
Missing_key if the value does not exist
val add :
context ->
value ->
Raw_context.t Mavryk_protocol_environment_alpha.Lwt.tAllocates the data and initializes it with a value ; just updates it if the bucket exists
val add_or_remove :
context ->
value option ->
Raw_context.t Mavryk_protocol_environment_alpha.Lwt.tWhen the value is Some v, allocates the data and initializes it with v ; just updates it if the bucket exists. When the value is None, deletes the storage bucket ; does nothing if the bucket does not exist.
val remove_existing :
context ->
Raw_context.t Mavryk_protocol_environment_alpha.Error_monad.tzresult
Mavryk_protocol_environment_alpha.Lwt.tDelete the storage bucket ; returns a Storage_error
Missing_key if the bucket does not exist
val remove : context -> Raw_context.t Mavryk_protocol_environment_alpha.Lwt.tRemoves the storage bucket and its contents ; does nothing if the bucket does not exist