package octez-l2-libs
Make_mutable_value(S)(V)
constructs a Mutable_value
for persisting a mutable value in a store. The module parameter S
defines the location of the mutable value in the store, and the module parameter V
contains information about the type of values that the constructed module will persist in the underlying store.
Parameters
module S : Store_sigs.STORAGE_INFO
module V : Store_sigs.VALUE
Signature
type 'a store = 'a t
The type of the store
that is used for persisting data on disk.
type value = V.value
The type of the values that will be persisted.
val path_key : Store_sigs.path
Path in the irmin tree.
val set :
[> `Write ] store ->
value ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
set store value
persists value
for this Mutable_value
on store
.
val get : [> `Read ] store -> value Tezos_base.TzPervasives.tzresult Lwt.t
get store
retrieves the value persisted in store
for this Mutable_value
. If the underlying storage backend fails to retrieve the contents of the mutable value by throwing an exception, then the exception is propagated by get store
.
val find :
[> `Read ] store ->
value option Tezos_base.TzPervasives.tzresult Lwt.t
find store
returns an optional value containing the value persisted in store
for this Mutable_value
. If no value is persisted for the Mutable_value
, None
is returned.