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: &[SassItem]);
    fn get_mixin(&self, name: &str) -> Option<(FormalArgs, Vec<SassItem>)>;
    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: &[SassItem]) -> 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

Define a variable with a value.

The $ sign is not included in name.

Define a variable in the global scope that is an ultimate parent of this scope.

Get the Value for a variable.

Provided Methods

Implementors