Skip to main content

VariableScope

Trait VariableScope 

Source
pub trait VariableScope {
    // Required methods
    fn lookup(&self, name: &str, descendant: bool) -> Found;
    fn functions(&self) -> Option<Rc<FunctionRegistry>>;

    // Provided methods
    fn dynamic(&self) -> Option<Rc<dyn VariableScope>> { ... }
    fn arguments(&self) -> Option<Rc<dyn VariableScope>> { ... }
}
Expand description

variables visible from a value

Required Methods§

Source

fn lookup(&self, name: &str, descendant: bool) -> Found

find a variable. descendant: the variable is referenced by a descendant of the element a mixin is applied to

Source

fn functions(&self) -> Option<Rc<FunctionRegistry>>

the custom function calls are evaluated. None when they are not evaluated

Provided Methods§

Source

fn dynamic(&self) -> Option<Rc<dyn VariableScope>>

the variables of the call site that are visible from the body of a custom function. the scope itself when None

Source

fn arguments(&self) -> Option<Rc<dyn VariableScope>>

the variables visible from the arguments of a custom function call. the scope itself when None

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§