Enum rsass::sass::Value[][src]

pub enum Value {
    Bang(String),
    Call(SassStringCallArgsSourcePos),
    Literal(SassString),
    List(Vec<Value>, ListSeparatorbool),
    Numeric(Numeric),
    Paren(Box<Value>, bool),
    Variable(String),
    Color(RgbaOption<String>),
    Null,
    True,
    False,
    BinOp(Box<Value>, boolOperatorboolBox<Value>),
    UnaryOp(OperatorBox<Value>),
    Map(Vec<(Value, Value)>),
    HereSelector,
    UnicodeRange(String),
}

A sass value.

Variants

Bang(String)

A special kind of escape. Only really used for !important.

A call has a name and an argument (which may be multi).

Literal(SassString)

A literal string value (quoted or not).

A comma- or space separated list of values, with or without brackets.

Numeric(Numeric)

A Numeric value is a rational value with a Unit (which may be Unit::None) and flags.

Paren(Box<Value>, bool)

“(a/b) and a/b differs semantically. Parens means the value should be evaluated numerically if possible, without parens / is not allways division. The boolean tells if the paren itself should be kept for output.

Variable(String)

A variable reference to be loaded when the value is evaluated.

Color(RgbaOption<String>)

Both a numerical and original string representation, since case and length should be preserved (#AbC vs #aabbcc).

Null

The null value.

True

The true boolean value.

False

The false boolean value.

BinOp(Box<Value>, boolOperatorboolBox<Value>)

A binary operation, two operands and an operator. The boolean represents possible whitespace.

UnaryOp(OperatorBox<Value>)

A unary operator and its operand.

A map in sass source is just a list of key/value parirs. Actual map behaviour comes after evaluating it.

HereSelector

The magic value “&”, exanding to the current selectors.

UnicodeRange(String)

A unicode range for font selections. U+NN, U+N?, U+NN-MM. The string is the entire value, including the “U+” tag.

Implementations

impl Value[src]

pub fn scalar(v: impl Into<Number>) -> Self[src]

Create a new scalar value.

pub fn is_true(&self) -> bool[src]

All values other than False and Null should be considered true.

pub fn is_null(&self) -> bool[src]

Return true if this value is null.

Note that an empty unquoted string and a list containing no non-null values is also considered null.

pub fn evaluate(&self, scope: ScopeRef) -> Result<Value, Error>[src]

Evaluate this value in a given scope.

pub fn do_evaluate(
    &self,
    scope: ScopeRef,
    arithmetic: bool
) -> Result<Value, Error>
[src]

Evaluate this value to a css::Value.

pub fn inspect(&self, out: &mut Formatter<'_>) -> Result[src]

Write a string representation of this value

This does not evaluate the value.

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Eq for Value[src]

impl PartialEq<Value> for Value[src]

impl PartialOrd<Value> for Value[src]

impl StructuralEq for Value[src]

impl StructuralPartialEq for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,