package octez-libs
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053
doc/octez-libs.stdlib/Tezos_stdlib/Hash_queue/Make/index.html
Module Hash_queue.MakeSource
Parameters
module K : Hashtbl.HashedTypemodule V : sig ... endSignature
The type of hash queues holding bindings from K.t to V.t
val create : int -> tcreate n creates an empty hash queue of capacity n. New elements added to a full hash queue push the oldest ones out.
remove q k removes the binding from k in q. If k is not bound in c, it does nothing.
replace q k v binds the key k to the value v in the queue q. This may or may not cause another binding to be removed, depending on the number of bindings already present in q.
find_opt q k is Some v if k is bound to v in q. It is None otherwise.
val length : t -> intlength q is the number of bindings held by q.
val capacity : t -> intcapacity q is the number of bindings q can hold: capacity (create n) = n
val clear : t -> unitclear q removes all bindings from q.
fold f q init folds the function f over the bindings of q. The elements are iterated from oldest to newest.
Folding in the Lwt monad, from oldest to newest.
val fold_es :
(K.t -> V.t -> 'a -> ('a, 'error) result Lwt.t) ->
t ->
'a ->
('a, 'error) result Lwt.tFolding in the error monad, from oldest to newest.
Returns the oldest element of the queue when not empty. Returns None when empty.
take q removes and returns the oldest element in queue q, or returns None if the queue is empty.
peek_at_most q n returns the oldest n elements of the queue q. If the queue has less than n elements, returns all elements of the queue.
take_at_most q n removes and returns the oldest n elements of the queue q. If the queue has less than n elements, removes and returns all elements of the queue.
Returns the keys of the elements stored in the queue from oldest to newest.