pub struct Scope<K: Hash + Eq, V>(/* private fields */);Expand description
Implementations§
Source§impl<K: Hash + Eq, V> Scope<K, V>
impl<K: Hash + Eq, V> Scope<K, V>
Sourcepub fn enter_scope(&mut self)
pub fn enter_scope(&mut self)
Creates a new scope at top of stack, acting as a new scope.
Sourcepub fn leave_scope(&mut self)
pub fn leave_scope(&mut self)
Leaves the scope by popping the top value of the HashMap vector stack.
Sourcepub fn get(&self, item: &K) -> Option<&V>
pub fn get(&self, item: &K) -> Option<&V>
Scans bottom-up from the scope stack to find the specified item
argument. This method recurses down the branches of the stack until it
finds the item (linear search).
Auto Trait Implementations§
impl<K, V> Freeze for Scope<K, V>
impl<K, V> RefUnwindSafe for Scope<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Scope<K, V>
impl<K, V> Sync for Scope<K, V>
impl<K, V> Unpin for Scope<K, V>
impl<K, V> UnwindSafe for Scope<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more