pub struct Scope { /* private fields */ }
Expand description

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.

Scopes are often accessed through a ScopeRef.

Implementations

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.

Create a scope for a built-in module.

Create a new subscope of a given parent.

Create a new subscope of a given parent with selectors.

Define a module in the scope.

This is used by the @use statement.

Get a module.

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

Get the format used in this scope.

Define a none-default, non-global variable.

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.

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

Copy a set of local variables to a temporary holder

Restore a set of local variables from a temporary holder

Get the global Value for a variable.

Get a mixin by name.

Returns the formal args and the body of the mixin.

Define a mixin.

Define a function.

Get a function by name.

Get the selectors active for this scope.

Get the functions of this scope as a Value::Map.

Get the variables of this scope as a Value::Map.

Get the forward scope for this scope.

Create a new one if necessary.

Get the forward scope for this scope, if any.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more