pub struct Environment { /* private fields */ }Implementations§
Source§impl Environment
impl Environment
pub fn new_enclosed_environment(outer: &Env) -> Self
pub fn get(&self, name: &str) -> Option<Rc<Object>>
pub fn set(&mut self, name: String, val: Rc<Object>)
Sourcepub fn snapshot(&self) -> Self
pub fn snapshot(&self) -> Self
Capture the bindings visible at a declaration site.
Values remain shared, and so are the frames’ maps until either side
writes again; a later let with the same name therefore cannot rewrite
what an existing closure sees, without copying every binding up front.
pub fn visible_names(&self) -> Vec<String>
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Environment
impl Debug for Environment
Source§impl Default for Environment
impl Default for Environment
Source§fn default() -> Environment
fn default() -> Environment
Returns the “default value” for a type. Read more
impl Eq for Environment
Source§impl PartialEq for Environment
impl PartialEq for Environment
impl StructuralPartialEq for Environment
Auto Trait Implementations§
impl !RefUnwindSafe for Environment
impl !Send for Environment
impl !Sync for Environment
impl !UnwindSafe for Environment
impl Freeze for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
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