pub type SpecifiedValue = VariableValue;
Expand description

Both specified and computed values are VariableValues, the difference is whether var() functions are expanded.

Aliased Type§

struct SpecifiedValue {
    css: String,
    first_token_type: TokenSerializationType,
    last_token_type: TokenSerializationType,
    references: VarOrEnvReferences,
}

Fields§

§css: String§first_token_type: TokenSerializationType§last_token_type: TokenSerializationType§references: VarOrEnvReferences

var() or env() references.

Implementations§

source§

impl VariableValue

source

fn empty() -> Self

source

fn push<'i>( &mut self, input: &Parser<'i, '_>, css: &str, css_first_token_type: TokenSerializationType, css_last_token_type: TokenSerializationType ) -> Result<(), ParseError<'i>>

source

fn push_from<'i>( &mut self, input: &Parser<'i, '_>, position: (SourcePosition, TokenSerializationType), last_token_type: TokenSerializationType ) -> Result<(), ParseError<'i>>

source

fn push_variable<'i>( &mut self, input: &Parser<'i, '_>, variable: &ComputedValue ) -> Result<(), ParseError<'i>>

source

pub fn parse<'i, 't>( input: &mut Parser<'i, 't> ) -> Result<Arc<Self>, ParseError<'i>>

Parse a custom property value.

source

fn integer(number: i32) -> Self

Create VariableValue from an int.

source

fn ident(ident: &'static str) -> Self

Create VariableValue from an int.

source

fn pixels(number: f32) -> Self

Create VariableValue from a float amount of CSS pixels.

source

fn int_pixels(number: i32) -> Self

Create VariableValue from an integer amount of CSS pixels.

source

fn from_token(token: Token<'_>) -> Self

source

pub fn css_text(&self) -> &str

Returns the raw CSS text from this VariableValue

source

pub fn has_references(&self) -> bool

Returns whether this variable value has any reference to the environment or other variables.

Trait Implementations§

source§

impl Clone for VariableValue

source§

fn clone(&self) -> VariableValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VariableValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl MallocSizeOf for VariableValue

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl PartialEq<VariableValue> for VariableValue

source§

fn eq(&self, other: &VariableValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ToCss for SpecifiedValue

source§

fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere W: Write,

Serialize self in CSS syntax, writing to dest.
source§

fn to_css_string(&self) -> String

Serialize self in CSS syntax and return a string. Read more
source§

impl ToShmem for VariableValue

source§

fn to_shmem(&self, builder: &mut SharedMemoryBuilder) -> Result<Self>

Clones this value into a form suitable for writing into a SharedMemoryBuilder. Read more
source§

impl StructuralPartialEq for VariableValue