[][src]Enum rsass::css::Value

pub enum Value {
    Bang(String),
    Call(StringCallArgs),
    Function(StringOption<SassFunction>),
    Literal(StringQuotes),
    List(Vec<Value>, ListSeparatorbool),
    Numeric(Number<isize>, Unitbool),
    NumericBig(Number<BigInt>, Unitbool),
    Color(Rgba, Option<String>),
    Null,
    True,
    False,
    BinOp(Box<Value>, bool, Operator, boolBox<Value>),
    UnaryOp(Operator, Box<Value>),
    Map(OrderMap<Value, Value>),
    UnicodeRange(String),
    Paren(Box<Value>),
}

A css value.

Variants

Bang(String)

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

An function call that was not evaluated.

A (callable?) function.

Literal(StringQuotes)

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

Numeric(Number<isize>, Unitbool)

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

The boolean flag is true for calculated values and false for literal values.

NumericBig(Number<BigInt>, Unitbool)

A rational value with a Unit and flags, similar to Numeric, but with support for arbitrarily large numbers.

Color(Rgba, Option<String>)
Null
True
False
BinOp(Box<Value>, bool, Operator, boolBox<Value>)

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

UnaryOp(Operator, Box<Value>)
Map(OrderMap<Value, Value>)
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.

Paren(Box<Value>)

Implementations

impl Value[src]

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

pub fn bool(v: bool) -> Self[src]

pub fn black() -> Self[src]

pub fn rgba(r: Rational, g: Rational, b: Rational, a: Rational) -> Self[src]

pub fn hsla(h: Rational, s: Rational, l: Rational, a: Rational) -> Self[src]

pub fn type_name(&self) -> &'static str[src]

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

pub fn into_calculated(self) -> Self[src]

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]

pub fn integer_value(&self) -> Result<isize, Error>[src]

pub fn unquote(self) -> Value[src]

pub fn iter_items(self) -> Vec<Value>[src]

pub fn format(&self, format: Format) -> Formatted<'_, Value>[src]

Get a reference to this Value bound to an output format.

The bound referene implements Display, so it can be written with the rust format!(...) macros or coverted with the to_string()` method.

Example

assert_eq!(
    Value::scalar(42).format(Default::default()).to_string(),
    "42",
);

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Eq for Value[src]

impl Ord for Value[src]

impl PartialEq<Value> for Value[src]

Some Values are equal according to spec even with some implementation differences.

impl PartialOrd<Value> for Value[src]

impl StructuralEq 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> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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