[−][src]Trait rsass::Scope
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_or_none(&self, name: &str) -> Option<Value>
Get the Value for a variable.
fn get_global_or_none(&self, name: &str) -> Option<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<Result<Value, Error>>
&self,
name: &str,
args: &CallArgs
) -> Option<Result<Value, Error>>
fn get_selectors(&self) -> &Selectors
Provided methods
fn define_multi(&mut self, names: &[String], value: &Value)
Define multiple names from a value that is a list. Special case: in names is a single name, value is used directly.
fn get(&self, name: &str) -> Result<Value, Error>
fn get_global(&self, name: &str) -> Result<Value, Error>
fn eval_body(&mut self, body: &[Item]) -> Result<Option<Value>, Error> where
Self: Sized,
Self: Sized,
Implementors
impl Scope for GlobalScope
[src]
fn define(&mut self, name: &str, val: &Value)
[src]
fn define_default(&mut self, name: &str, val: &Value, _global: bool)
[src]
fn define_global(&self, name: &str, val: &Value)
[src]
fn get_mixin(&self, name: &str) -> Option<(FormalArgs, Vec<Item>)>
[src]
fn get_or_none(&self, name: &str) -> Option<Value>
[src]
fn get_global_or_none(&self, name: &str) -> Option<Value>
[src]
fn define_mixin(&mut self, name: &str, args: &FormalArgs, body: &[Item])
[src]
fn define_function(&mut self, name: &str, func: SassFunction)
[src]
fn get_function(&self, name: &str) -> Option<&SassFunction>
[src]
fn call_function(
&self,
name: &str,
args: &CallArgs
) -> Option<Result<Value, Error>>
[src]
&self,
name: &str,
args: &CallArgs
) -> Option<Result<Value, Error>>