Enum rsass::css::Value [−][src]
pub enum Value {
Show 16 variants
Bang(String),
Call(String, CallArgs),
Function(String, Option<Function>),
Literal(CssString),
List(Vec<Value>, Option<ListSeparator>, bool),
Numeric(Numeric, bool),
Color(Color, Option<String>),
Null,
True,
False,
BinOp(Box<Value>, bool, Operator, bool, Box<Value>),
UnaryOp(Operator, Box<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(String, CallArgs)
An function call that was not evaluated.
Function(String, Option<Function>)
A (callable?) function.
Literal(CssString)
Tuple Fields
0: CssString
A string literal.
List(Vec<Value>, Option<ListSeparator>, bool)
A comma- or space separated list of values, with or without brackets.
Numeric(Numeric, 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(Color, Option<String>)
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>, bool, Operator, bool, Box<Value>)
A binary operation, two operands and an operator. The booleans represents possible whitespace.
UnaryOp(Operator, Box<Value>)
A unary operator and its operand.
Map(ValueMap)
Tuple Fields
0: ValueMap
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>)
A value in parenthesis.
ArgList(CallArgs)
Tuple Fields
0: CallArgs
An argumentt list
Implementations
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.
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
Some Values are equal according to spec even with some implementation differences.
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
type Error = BadSelector
type Error = BadSelector
The type returned in the event of a conversion error.
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Value
impl !UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more