Enum rustc_data_structures::sso::SsoHashMap [−][src]
Expand description
Small-storage-optimized implementation of a map.
Stores elements in a small array up to a certain length
and switches to HashMap
when that length is exceeded.
Variants
Map(FxHashMap<K, V>)
Tuple Fields of Map
0: FxHashMap<K, V>
Implementations
Creates an empty SsoHashMap
with the specified capacity.
Clears the map, removing all key-value pairs. Keeps the allocated memory for reuse.
Returns the number of elements the map can hold without reallocating.
An iterator visiting all key-value pairs in arbitrary order.
The iterator element type is (&'a K, &'a V)
.
An iterator visiting all key-value pairs in arbitrary order,
with mutable references to the values.
The iterator element type is (&'a K, &'a mut V)
.
An iterator visiting all keys in arbitrary order.
The iterator element type is &'a K
.
An iterator visiting all values in arbitrary order.
The iterator element type is &'a V
.
An iterator visiting all values mutably in arbitrary order.
The iterator element type is &'a mut V
.
Changes underlying storage from array to hashmap if array is full.
Reserves capacity for at least additional
more elements to be inserted
in the SsoHashMap
. The collection may reserve more space to avoid
frequent reallocations.
Shrinks the capacity of the map as much as possible. It will drop down as much as possible while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
Retains only the elements specified by the predicate.
Inserts a key-value pair into the map.
If the map did not have this key present, None
is returned.
If the map did have this key present, the value is updated, and the old
value is returned. The key is not updated, though; this matters for
types that can be ==
without being identical. See the [module-level
documentation] for more.
Removes a key from the map, returning the value at the key if the key was previously in the map.
Removes a key from the map, returning the stored key and value if the key was previously in the map.
Returns a reference to the value corresponding to the key.
Returns a mutable reference to the value corresponding to the key.
Returns the key-value pair corresponding to the supplied key.
Returns true
if the map contains a value for the specified key.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
Which kind of iterator are we turning this into?
Which kind of iterator are we turning this into?
Auto Trait Implementations
impl<K, V> RefUnwindSafe for SsoHashMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for SsoHashMap<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for SsoHashMap<K, V> where
K: Sync,
V: Sync,
impl<K, V> Unpin for SsoHashMap<K, V> where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for SsoHashMap<K, V> where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.