To focus the search input from anywhere on the page, press the 'S' key.
in-package search v0.1.0
-
tezos-crypto
-
Library
Module
Module type
Parameter
Class
Class type
include Tezos_error_monad.Error_table.S with type key = t
type key = t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val find_or_make :
'a t ->
key ->
(unit -> 'a Tezos_error_monad.Error_monad.tzresult Lwt.t) ->
'a Tezos_error_monad.Error_monad.tzresult Lwt.t
find_or_make t k gen
is p
if k
is already bound to k
in t
. In this case, no side-effect is performed.
find_or_make t k gen
is r
if k
is not bound in t
where r
is gen
()
. In this case, r
becomes bound to k
in t
. In addition, a listener is added to r
so that if r
resolves to Error _
, the binding is removed.
val find_opt :
'a t ->
key ->
'a Tezos_error_monad.Error_monad.tzresult Lwt.t option
find_opt t k
is None
if there are no bindings for k
in t
, and Some p
if p
is bound to k
in t
.
iter_{s,p} f t
iterates f
over the promises of t
. It blocks on unresolved promises and only applies the function on the ones that resolve successfully.
fold f t init
folds f
over the successfully resolving promises of t
. I.e., it goes through the promises in the table and waits for each of the promise to resolve in order to fold over it.
val fold_promises :
(key -> 'a Tezos_error_monad.Error_monad.tzresult Lwt.t -> 'b -> 'b) ->
'a t ->
'b ->
'b
fold_promises f t init
folds f
over the promises of t
.
fold_resolved f t init
folds f
over the successfully resolved promises of t
.
fold_keys f t init
folds f
over the keys bound in t
.
val length : 'a t -> int