pub type ComputedValue = Value<ComputedValueComponent>;
Expand description

Computed custom property value.

Aliased Type§

struct ComputedValue {
    pub(crate) v: ValueInner<GenericValueComponent<CSSPixelLength, f32, Percentage, LengthPercentage, GenericColor<Percentage>, GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, ComputedUrl, i32, Angle, Time, Resolution, GenericTransform<GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>>>>,
    url_data: UrlExtraData,
}

Fields§

§v: ValueInner<GenericValueComponent<CSSPixelLength, f32, Percentage, LengthPercentage, GenericColor<Percentage>, GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<CSSPixelLength>, NonNegative<LengthPercentage>, GenericPosition<LengthPercentage, LengthPercentage>, Angle, AngleOrPercentage, GenericColor<Percentage>>, ComputedUrl, GenericColor<Percentage>, Percentage, Resolution>, ComputedUrl, i32, Angle, Time, Resolution, GenericTransform<GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>>>>

The registered custom property value.

§url_data: UrlExtraData

The URL data of the registered custom property from before it was computed. This is necessary to uncompute registered custom properties.

Implementations§

source§

impl ComputedValue

source

fn serialization_types( &self ) -> (TokenSerializationType, TokenSerializationType)

source

fn to_declared_value(&self) -> Arc<ComputedPropertyValue>

source

pub fn as_universal(&self) -> Option<&Arc<ComputedPropertyValue>>

Returns the contained variable value if it exists, otherwise None.

source

pub fn is_parsed(&self, registration: &PropertyRegistrationData) -> bool

Returns whether the the property is computed.

source

pub fn to_variable_value(&self) -> ComputedPropertyValue

Convert to an untyped variable value.

source§

impl<Component> Value<Component>

source

pub fn new(v: ValueInner<Component>, url_data: UrlExtraData) -> Self

Creates a new registered custom property value.

source

pub fn universal(var: Arc<ComputedPropertyValue>) -> Self

Creates a new registered custom property value presumed to have universal syntax.

Trait Implementations§

source§

impl<Component: Animate> Animate for Value<Component>

source§

fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()>

Animate a value towards another one, given an animation procedure.
source§

impl<Component: Clone> Clone for Value<Component>

source§

fn clone(&self) -> Value<Component>

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<Component: Debug> Debug for Value<Component>

source§

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

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

impl<Component> MallocSizeOf for Value<Component>where Component: MallocSizeOf,

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<Component: PartialEq> PartialEq<Value<Component>> for Value<Component>

source§

fn eq(&self, other: &Value<Component>) -> 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<Component> ToCss for Value<Component>where Component: ToCss,

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<Component> StructuralPartialEq for Value<Component>