Releases: JustForFun88/double-map
Releases · JustForFun88/double-map
Version 0.4.0
Added
iter
DHashMap
method for creation an iterator visiting all keys-value tuples in arbitrary order.
Changed
Nothign
Removed
Nothign
Fixed
Nothing
Version 0.3.0
Added
Default
trait implementation forDHashMap
;dhashmap!
for creation aDHashMap<K1, K2, V,
RandomState
>
from a list of sequentially given keys and values;- Add documentation for
Extend
trait; - Add documentation for
FromIterator
trait.
Changed
Nothign
Removed
Nothign
Fixed
Nothing
Version 0.2.0
Added
Extend
trait implementation forDHashMap
;FromIterator
trait implementation forDHashMap
;
Changed
- Documentation was improved.
DHashMap
was moved to separate moduledhash_map
.TryInsertError::Other
variant changed to theTryInsertError::Insert
variant.
Fixed
DHashMap::entry
method (and through thisDHashMap::try_insert
,DHashMap::insert
methods) realizations
was changed.
Compatibility
- Because of moving
DHashMap
to the separate moduledhash_map
,EntryError
structure,InsertError
structure,
OccupiedEntry
structure,OccupiedError
structure,VacantEntry
structure,Entry
enum,
ErrorKind
enum,TryInsertError
enum can not be used directly from crate root likeuse double_map::DHashMap
.
You need change syntax to use submodule, like thisuse double_map::dhash_map::EntryError
. TryInsertError::Other
variant changed to theTryInsertError::Insert
variant.
Version 0.1.1
Added Change log.
Changed Readme.
Changed Cargo.toml to version v0.1.1.
Deleted dublicate lib.rs file on the root of crate.
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
. ↩