pub struct Env {
pub root: Val,
pub current: Val,
/* private fields */
}Fields§
§root: Val§current: ValImplementations§
Source§impl Env
impl Env
pub fn new_with_registry(root: Val, registry: Arc<MethodRegistry>) -> Self
pub fn with_current(&self, current: Val) -> Self
Sourcepub fn swap_current(&mut self, new: Val) -> Val
pub fn swap_current(&mut self, new: Val) -> Val
In-place swap of current — returns previous. Paired with
restore_current this lets hot loops avoid cloning vars/root
per iteration.
pub fn restore_current(&mut self, old: Val)
pub fn get_var(&self, name: &str) -> Option<&Val>
pub fn has_var(&self, name: &str) -> bool
pub fn with_var(&self, name: &str, val: Val) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Env
impl !RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnsafeUnpin for Env
impl !UnwindSafe for Env
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