pub struct ScopedContext { /* private fields */ }Expand description
A multi-scope context that supports pushing and popping entire scopes.
Each scope contains a set of local variables; popping a scope removes all locals introduced since the last push.
Implementations§
Source§impl ScopedContext
impl ScopedContext
Sourcepub fn push_scope(&mut self)
pub fn push_scope(&mut self)
Push a new scope.
Sourcepub fn pop_scope(&mut self)
pub fn pop_scope(&mut self)
Pop the current scope, removing all locals introduced since the last push.
Sourcepub fn scope_depth(&self) -> usize
pub fn scope_depth(&self) -> usize
Depth of the scope stack.
Sourcepub fn num_locals(&self) -> usize
pub fn num_locals(&self) -> usize
Number of locals in the inner context.
Trait Implementations§
Source§impl Clone for ScopedContext
impl Clone for ScopedContext
Source§fn clone(&self) -> ScopedContext
fn clone(&self) -> ScopedContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScopedContext
impl Debug for ScopedContext
Auto Trait Implementations§
impl Freeze for ScopedContext
impl RefUnwindSafe for ScopedContext
impl Send for ScopedContext
impl Sync for ScopedContext
impl Unpin for ScopedContext
impl UnsafeUnpin for ScopedContext
impl UnwindSafe for ScopedContext
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