pub struct ScopedEnv { /* private fields */ }Expand description
A scoped environment mapping variables to SSA values.
Implementations§
Source§impl ScopedEnv
impl ScopedEnv
pub fn new() -> Self
pub fn get(&self, var: &VarId) -> Option<&SsaVal>
pub fn contains_key(&self, var: &VarId) -> bool
pub fn insert(&mut self, var: VarId, val: SsaVal) -> Option<SsaVal>
Sourcepub fn restore(&mut self, var: VarId, old: Option<SsaVal>)
pub fn restore(&mut self, var: VarId, old: Option<SsaVal>)
Restores a variable to its previous state.
pub fn iter(&self) -> Iter<'_, VarId, SsaVal>
pub fn keys(&self) -> Keys<'_, VarId, SsaVal>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn insert_scoped(&mut self, scope: &mut EnvScope, var: VarId, val: SsaVal)
pub fn insert_scoped(&mut self, scope: &mut EnvScope, var: VarId, val: SsaVal)
Inserts a variable into the environment and records the old value in the scope.
Sourcepub fn restore_scope(&mut self, scope: EnvScope)
pub fn restore_scope(&mut self, scope: EnvScope)
Restores all variables saved in the scope in reverse order.
Auto Trait Implementations§
impl Freeze for ScopedEnv
impl RefUnwindSafe for ScopedEnv
impl Send for ScopedEnv
impl Sync for ScopedEnv
impl Unpin for ScopedEnv
impl UnsafeUnpin for ScopedEnv
impl UnwindSafe for ScopedEnv
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