Hashtbl.Tx
Transactions on hash tables.
length t
returns the number of bindings in the hash table t
.
⚠️ The returned value may be greater than the number of distinct keys in the hash table.
reset t
remove all bindings from the hash table t
and shrinks the capacity of the table back to the minimum.
remove t k
removes the most recent existing binding of key k
, if any, from the hash table t
thereby revealing the earlier binding of k
, if any.
add t k v
adds a binding of key k
to value v
to the hash table shadowing the previous binding of the key k
, if any.
⚠️ Consider using replace
instead of add
.
replace t k v
adds a binding of key k
to value v
or replaces the most recent existing binding of key k
in the hash table t
.
find_opt t k
returns the current binding of key k
in the hash table t
, or None
if no such binding exists.