Version 0.1.0
Initial publication. Created DHashmap
data structure, and add some methods to it1:
new
: creates a new emptyDHashMap
;with_capacity
: creates an emptyDHashMap
with the specified capacity;with_hasher
: creates an emptyDHashMap
which will use the given hash builder to hash keys;with_capacity_and_hasher
: creates an emptyDHashMap
with the specified capacity, usinghash_builder
to hash the keys;capacity
: returns the number of elements the map can hold without reallocating;len
: returns the number of elements in the map.;is_empty
: returnstrue
if the map contains no elements;clear
: clears the map, removing all keys-value tuples(K1, K2, V)
. Keeps the allocated memory for reuse;hasher
: returns a reference to the map'sBuildHasher
;reserve
: reserves capacity for at leastadditional
more elements;try_reserve
: tries to reserve capacity for at leastadditional
more elements;shrink_to_fit
: shrinks the capacity of the map as much as possible;shrink_to
: shrinks the capacity of the map with a lower limit;entry
: tries to gets the given keys' corresponding entry in the map for in-place manipulation. Return error if primaryK1
key or secondaryK2
not both vacant or exist and refers to the same value. Given keys returned insideerror
structure.get_key1
: returns a reference to the value corresponding to the given primary key(K1)
;get_key2
: returns a reference to the value corresponding to the given secondary key(K2)
;get_mut_key1
: returns a mutable reference to the value corresponding to the given primary key(K1)
;get_mut_key2
: returns a reference to the value corresponding to the given secondary key(K2)
;insert_unchecked
: insert keys-value tuple(K1, K2, V)
into the map without checking that primaryK1
key or secondaryK2
key vacant or exist in map and refers to the same value.insert
: insert keys-value tuple(K1, K2, V)
into the map(K1, K2, V)
with checking that primaryK1
key or secondaryK2
key vacant or exist in map and refers to the same value. Return error if its failure. Given keys and value returned insideerror
structure.try_insert
: tries insert keys-value tuple(K1, K2, V)
into the map if they vacant and returning error if any of keys or both keys exist in the map. Given value or value and keys together returned insideerror
enum (depends error type).remove_key1
: remove element from map corresponding to the given primary key(K1)
;remove_key2
: remove element from map corresponding to the given secondary key(K2)
.
-
The
K1
,K2
,V
abbreviations means:K1
- a primary key of typeK1
;K2
- a secondary key of typeK2
;V
- a value of typeK2
. ↩