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

pub enum Value {
Show 16 variants Bang(String), Call(StringCallArgs), Function(StringOption<Function>), Literal(CssString), List(Vec<Value>, Option<ListSeparator>, bool), Numeric(Numericbool), Color(ColorOption<String>), Null, True, False, BinOp(Box<Value>, boolOperatorboolBox<Value>), UnaryOp(OperatorBox<Value>), Map(ValueMap), UnicodeRange(String), Paren(Box<Value>), ArgList(CallArgs),
}
Expand description

A css value.

Variants

Bang(String)

Tuple Fields

0: String

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

Call(StringCallArgs)

Tuple Fields

0: String

An function call that was not evaluated.

Function(StringOption<Function>)

Tuple Fields

0: String

A (callable?) function.

Literal(CssString)

Tuple Fields

A string literal.

List(Vec<Value>, Option<ListSeparator>, bool)

Tuple Fields

0: Vec<Value>
2: bool

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

Numeric(Numericbool)

Tuple Fields

1: bool

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.

Color(ColorOption<String>)

Tuple Fields

0: Color

A color value (and optionally, its source string).

Null

The null value.

True

The true boolean value.

False

The false boolean value.

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

Tuple Fields

0: Box<Value>
1: bool
3: bool
4: Box<Value>

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

UnaryOp(OperatorBox<Value>)

Tuple Fields

1: Box<Value>

A unary operator and its operand.

Map(ValueMap)

Tuple Fields

A map of values.

UnicodeRange(String)

Tuple Fields

0: 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>)

Tuple Fields

0: Box<Value>

A value in parenthesis.

ArgList(CallArgs)

Tuple Fields

An argumentt list

Implementations

Create a numeric value with no unit.

Get the type name of this value.

Return true if this is a calculated value.

The return of functions or operators are calculated, verbatim values are not.

Get this value, but marked as calculated.

Make sure arithmetic operators are evaluated.

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

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.

Check if this value is numeric.

If it is, get the number and unit, otherwise, get the value itself as error.

👎 Deprecated

Check that this value is an integer.

Unquote this value.

If the value is a quoted string, the content is unquoted.

Get this value as iterable items.

Lists and maps have iterable items, which are returned as a vector of values. Other values are returned as a vec containing the value as a single item.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Create a css Value representing a set of selectors.

The result will be a comma-separated list of space-separated lists of strings, or null if this is a root (empty) selector.

Performs the conversion.

Performs the conversion.

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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.

The type returned in the event of a conversion error.

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.