pub struct StaticEnvironment { /* private fields */ }
Expand description
Stack of local variables in nested scopes
Each scope represents a Ruby scope:
# 1
class A
# 1, 2
def m
# 1, 2, 3
end
# 1, 2
end
# 1
In the example above comments show what’s in the stack. Basically, it’s pushed when you enter a new scope and it’s popped when exit it.
Implementations§
Source§impl StaticEnvironment
impl StaticEnvironment
Sourcepub fn extend_static(&self)
pub fn extend_static(&self)
Performs a push, doesn’t inherit previously declared variables in the new scope
Handles class/module scopes
Sourcepub fn extend_dynamic(&self)
pub fn extend_dynamic(&self)
Performs a push, inherits previously declared variables in the new scope
Handles block/lambda scopes
Sourcepub fn is_declared(&self, name: &str) -> bool
pub fn is_declared(&self, name: &str) -> bool
Returns true
if variable with a given name
is declared in the current scope
Trait Implementations§
Source§impl Clone for StaticEnvironment
impl Clone for StaticEnvironment
Source§fn clone(&self) -> StaticEnvironment
fn clone(&self) -> StaticEnvironment
Returns a copy 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 StaticEnvironment
impl Debug for StaticEnvironment
Source§impl Default for StaticEnvironment
impl Default for StaticEnvironment
Source§fn default() -> StaticEnvironment
fn default() -> StaticEnvironment
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StaticEnvironment
impl !RefUnwindSafe for StaticEnvironment
impl !Send for StaticEnvironment
impl !Sync for StaticEnvironment
impl Unpin for StaticEnvironment
impl !UnwindSafe for StaticEnvironment
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