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§
Sourcefn lookup(&self, name: &str, descendant: bool) -> Found
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
Sourcefn functions(&self) -> Option<Rc<FunctionRegistry>>
fn functions(&self) -> Option<Rc<FunctionRegistry>>
the custom function calls are evaluated. None when they are not evaluated
Provided Methods§
Sourcefn dynamic(&self) -> Option<Rc<dyn VariableScope>>
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
Sourcefn arguments(&self) -> Option<Rc<dyn VariableScope>>
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".