Struct quickscope::ScopeSet
source · [−]pub struct ScopeSet<T, S: BuildHasher = RandomState> { /* private fields */ }
Expand description
A layered hash set for representing the scopes of variables.
Implementations
Creates an empty ScopeSet
with a default hasher and the specified capacity.
Creates an empty ScopeSet
with the specified hasher and a default capacity.
Creates an empty ScopeSet
with the specified capacity and hasher.
Gets the number of elements the set can hold without reallocating.
Adds a new, empty layer.
Computes in O(1) time.
Adds the specified key to the layer min_depth
layers below the top layer. Saturates to base layer.
Removes the specified key from the topmost layer and returns it.
Returns true
if any layer contains the specified key.
Computes in O(1) time.
Returns true
if the topmost layer contains the specified key.
Computes in O(1) time.
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 depth of the specified key (i.e. how many layers down from the top that the key first appears),
but ignores a maximum number of layers from the top equal to min_depth
.
Saturates to base 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.
Gets the height of the specified key (i.e. how many layers up from the bottom that the key last appears),
but ignores a maximum number of layers from the top equal to min_depth
.
A height of 0 refers to the bottom layer.
Saturates to base layer.
Returns None
if the key does not exist.
Computes in O(n) time (worst-case) in relation to layer count.
Iterates over the keys in arbitrary order.
The iterator element type is &'a T
.
Trait Implementations
Auto Trait Implementations
impl<T, S> RefUnwindSafe for ScopeSet<T, S> where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> UnwindSafe for ScopeSet<T, S> where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more