A BytesMap
is a dictionnary mapping unique keys to values, where all keys are
byte strings.
Insert, remove, and query operations all take O(log n) time.
Insert a key-value pair into a BytesMap
. Replaces value when there is a collision.
Update the value of a BytesMap
for a specific key with a given function.
Remove a key-value pair from a BytesMap
. If the key is not found, no changes
are made.
Get the value associated with a key. If the key is not found, return Nothing
. This is useful when you are not sure if a key will be in the BytesMap
Get all of the keys in a BytesMap
, sorted from lowest to highest.
Convert a BytesMap
into an association list of key-value pairs, sorted by keys.
Apply a function to all keys and values in a BytesMap
.
Fold over the values in a BytesMap
from lowest key to highest key.
Fold over the key-value pairs in a BytesMap
from lowest key to highest key.
Fold over the values in a BytesMap
from highest key to lowest key.
Fold over the key-value pairs in a BytesMap
from highest key to lowest key.
Keep only the key-value pairs that pass the given test.
Combine two BytesMap
. If there is a collision, preference is given to
the first BytesMap
.
Keep a key-value pair when its key appears in the second BytesMap
.
Preference is given to values in the first BytesMap
.
Keep a key-value pair when its key does not appear in the second BytesMap
.
The most general way of combining two BytesMap
. You provide three accumulators for when a given key appears:
BytesMap
.BytesMap
.BytesMap
.You then traverse all the keys from lowest to highest, building up whatever you want.
Dictionary mapping [Bytes] keys to values.