Struct quickscope::ScopeMap
source · [−]pub struct ScopeMap<K, V, S: BuildHasher = RandomState> { /* private fields */ }
Expand description
A layered hash map for representing scoped variables and their values.
Implementations
Creates an empty ScopeMap
with a default hasher and capacity.
Creates an empty ScopeMap
with a default hasher and the specified capacity.
Creates an empty ScopeMap
with the specified hasher and a default capacity.
Creates an empty ScopeMap
with the specified hasher and capacity.
Gets the number of elements the map can hold without reallocating.
Adds a new, empty layer.
Computes in O(1) time.
Returns true
if the map contains the specified key in any layer.
Computes in O(1) time.
Returns true
if the map contains the specified key at the top layer.
Computes in O(1) time.
Gets a reference to the topmost value associated with a key.
Computes in O(1) time.
Gets an iterator over references to all the values associated with a key, starting with the topmost and going down.
Computes in O(1) time.
Gets a mutable reference to the topmost value associated with a key.
Computes in O(1) time.
Gets an iterator over mutable references to all the values associated with a key, starting with the topmost and going down.
Computes in O(1) time.
Gets a reference to a value min_depth
layers below the topmost value associated with a key.
Saturates to base layer.
Computes in O(n) time (worst-case) in relation to min_depth
.
Gets a reference to the value associated with a key at least min_depth
layers below the topmost layer, as well as its associated depth.
Saturates to base layer.
Computes in O(n) time (worst-case) in relation to min_depth
.
Gets a reference to the value associated with a key at least min_depth
layers below the topmost layer, as well as its associated height.
Saturates to base layer.
Computes in O(n) time (worst-case) in relation to min_depth
.
Gets an iterator over references to all values min_depth
layers below the topmost value associated with a key.
Saturates to base layer.
Computes in O(n) time (worst-case) in relation to min_depth
.
Gets a mutable reference to a value min_depth
layers below the topmost value associated with a key.
Saturates to base layer.
Computes in O(n) time (worst-case) in relation to min_depth
.
Gets an iterator over mutable references to all values min_depth
layers below the topmost value associated with a key.
Saturates to base layer.
Computes in O(n) time (worst-case) in relation to min_depth
.
Gets the depth of the specified key (i.e. how many layers down from the top that the key first appears). A depth of 0 refers to the top layer.
Returns None
if the key does not exist.
Computes in O(n) time (worst-case) in relation to layer count.
Gets the height of the specified key (i.e. how many layers up from the bottom that the key last appears). A height of 0 refers to the bottom layer.
Returns None
if the key does not exist.
Computes in O(n) time (worst-case) in relation to layer count.
Adds the specified entry in the layer min_depth
layers from the top. Saturates to base layer.
Removes the entry with the specified key from the topmost layer and returns its value.
Iterates over all key-value pairs in arbitrary order.
The iterator element type is (&'a K, &'a V)
.
Iterates over all key-value pairs in the topmost layer in arbitrary order.
The iterator element type is (&'a K, &'a V)
.
Iterates over all key-value pairs in arbitrary order, allowing mutation of the values.
The iterator element type is (&'a K, &'a mut V)
.
Iterates over all keys in arbitrary order.
The iterator element type is &'a K
.
Trait Implementations
Auto Trait Implementations
impl<K, V, S> RefUnwindSafe for ScopeMap<K, V, S> where
K: RefUnwindSafe,
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V, S> UnwindSafe for ScopeMap<K, V, S> where
K: UnwindSafe,
S: UnwindSafe,
V: UnwindSafe + RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more