package tezos-protocol-alpha
Parameters
Signature
type key = Key.t
module Map : Tezos_protocol_environment_alpha.Map.S with type key = key
type value = Value.t
val empty : capacity:int64 -> t
empty ~capacity
returns a new table whose maximum capacity is given.
val encoding : t Tezos_protocol_environment_alpha.Data_encoding.t
Encoding for values of type t
val pp : Tezos_protocol_environment_alpha.Format.formatter -> t -> unit
Pretty-printer for values of type t
find key t
returns Some value
if there exists some value
associated to key
in the table, and None
otherwise.
val remember :
key ->
value ->
t ->
t Tezos_protocol_environment_alpha.Error_monad.tzresult
remember key value t
inserts a new entry (key |-> value)
in t
.
If key
already exists in t
, its associated binding value'
should be equal to value
. In this case, t
is returned unchanged. Otherwise, an error Key_bound_to_different_value
is returned.
If key
is not already present in t
, the new binding (key |-> value) is inserted in t
. If the number of elements would exceed t
's capacity after the insertion of the new binding, the oldest binding is removed from t
.
The structure t
is returned unchanged if its capacity
is negative or null.
module Internal_for_tests : sig ... end