Trait rsass::Scope
[−]
[src]
pub trait Scope { fn define(&mut self, name: &str, val: &Value); fn define_default(&mut self, name: &str, val: &Value, global: bool); fn define_global(&self, name: &str, val: &Value); fn get(&self, name: &str) -> Value; fn get_global(&self, name: &str) -> Value; fn define_mixin(&mut self, name: &str, args: &FormalArgs, body: &[Item]); fn get_mixin(&self, name: &str) -> Option<(FormalArgs, Vec<Item>)>; fn define_function(&mut self, name: &str, func: SassFunction); fn get_function(&self, name: &str) -> Option<&SassFunction>; fn call_function(&self, name: &str, args: &CallArgs) -> Option<Value>; fn eval_body(&mut self, body: &[Item]) -> Option<Value>
where
Self: Sized, { ... } }
Variables, functions and mixins are defined in a Scope
.
A scope can be a local scope, e.g. in a function, or the global scope. All scopes except the global scope has a parent. The global scope is global to a sass document, multiple different global scopes may exists in the same rust-language process.
Required Methods
fn define(&mut self, name: &str, val: &Value)
Define a variable with a value.
The $
sign is not included in name
.
fn define_default(&mut self, name: &str, val: &Value, global: bool)
fn define_global(&self, name: &str, val: &Value)
Define a variable in the global scope that is an ultimate parent of this scope.
fn get(&self, name: &str) -> Value
Get the Value for a variable.
fn get_global(&self, name: &str) -> Value
fn define_mixin(&mut self, name: &str, args: &FormalArgs, body: &[Item])
fn get_mixin(&self, name: &str) -> Option<(FormalArgs, Vec<Item>)>
fn define_function(&mut self, name: &str, func: SassFunction)
fn get_function(&self, name: &str) -> Option<&SassFunction>
fn call_function(&self, name: &str, args: &CallArgs) -> Option<Value>
Provided Methods
Implementors
impl Scope for GlobalScope