Struct rsass::Scope[][src]

pub struct Scope { /* fields omitted */ }

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 non-global scopes have a parent. The global scope is global to a sass document, multiple different global scopes may exists in the same rust-language process.

Implementations

impl<'a> Scope[src]

pub fn new_global(format: Format) -> Self[src]

Create a new global scope.

A “global” scope is just a scope that have no parent. There will be multiple global scopes existing during the evaluation of a single sass file.

pub fn builtin_module(name: &'static str) -> Self[src]

Create a scope for a built-in module.

pub fn sub(parent: ScopeRef) -> Self[src]

Create a new subscope of a given parent.

pub fn sub_selectors(parent: ScopeRef, selectors: Selectors) -> Self[src]

Create a new subscope of a given parent with selectors.

pub fn define_module(&self, name: Name, module: ScopeRef)[src]

Define a module in the scope.

This is used by the @use statement.

pub fn get_module(&self, name: &Name) -> Option<ScopeRef>[src]

Get a module.

This is used when refering to a function or variable with namespace.name notation.

pub fn get_format(&self) -> Format[src]

Get the format used in this scope.

pub fn define(&self, name: Name, val: &Value)[src]

Define a none-default, non-global variable.

pub fn set_variable(&self, name: Name, val: Value, default: bool, global: bool)[src]

Define a variable with a value.

The $ sign is not included in name.

pub fn define_global(&self, name: Name, val: Value)[src]

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

pub fn define_multi(&self, names: &[Name], value: &Value)[src]

Define multiple names from a value that is a list. Special case: in names is a single name, value is used directly.

pub fn get_or_none(&self, name: &Name) -> Option<Value>[src]

Get the Value for a variable.

pub fn get(&self, name: &str) -> Result<Value, Error>[src]

Get the value for a variable (or an error).

pub fn store_local_values(&self, names: &[Name]) -> Vec<(Name, Option<Value>)>[src]

Copy a set of local variables to a temporary holder

pub fn restore_local_values(&self, data: Vec<(Name, Option<Value>)>)[src]

Restore a set of local variables from a temporary holder

pub fn get_global_or_none(&self, name: &Name) -> Option<Value>[src]

Get the global Value for a variable.

pub fn get_mixin(&self, name: &Name) -> Option<Mixin>[src]

Get a mixin by name.

Returns the formal args and the body of the mixin.

pub fn define_mixin(&self, name: Name, mixin: Mixin)[src]

Define a mixin.

pub fn define_function(&self, name: Name, func: Function)[src]

Define a function.

pub fn get_function(&self, name: &Name) -> Option<Function>[src]

Get a function by name.

pub fn get_selectors(&self) -> &Selectors[src]

Get the selectors active for this scope.

pub fn expose_star(&self, other: &Scope)[src]

Expose another module directly in this.

This is use other as * behavior.

Auto Trait Implementations

impl RefUnwindSafe for Scope

impl Send for Scope

impl Sync for Scope

impl Unpin for Scope

impl UnwindSafe for Scope

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,