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
impl ComputedValue
fn serialization_types( &self, ) -> (TokenSerializationType, TokenSerializationType)
fn to_declared_value(&self) -> CustomDeclarationValue
Sourcepub fn as_universal(&self) -> Option<&Arc<ComputedPropertyValue>>
pub fn as_universal(&self) -> Option<&Arc<ComputedPropertyValue>>
Returns the contained variable value if it exists, otherwise None
.
Sourcepub fn is_parsed(&self, registration: &PropertyRegistrationData) -> bool
pub fn is_parsed(&self, registration: &PropertyRegistrationData) -> bool
Returns whether the the property is computed.
Sourcepub fn to_variable_value(&self) -> ComputedPropertyValue
pub fn to_variable_value(&self) -> ComputedPropertyValue
Convert to an untyped variable value.
Source§impl<Component> Value<Component>
impl<Component> Value<Component>
Sourcepub fn new(v: ValueInner<Component>, url_data: UrlExtraData) -> Self
pub fn new(v: ValueInner<Component>, url_data: UrlExtraData) -> Self
Creates a new registered custom property value.
Sourcepub fn universal(var: Arc<ComputedPropertyValue>) -> Self
pub fn universal(var: Arc<ComputedPropertyValue>) -> Self
Creates a new registered custom property value presumed to have universal syntax.
Trait Implementations
Source§impl<Component> MallocSizeOf for Value<Component>where
Component: MallocSizeOf,
impl<Component> MallocSizeOf for Value<Component>where
Component: MallocSizeOf,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
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> ToComputedValue for Value<Component>where
Component: ToComputedValue,
impl<Component> ToComputedValue for Value<Component>where
Component: ToComputedValue,
Source§type ComputedValue = Value<<Component as ToComputedValue>::ComputedValue>
type ComputedValue = Value<<Component as ToComputedValue>::ComputedValue>
The computed value type we’re going to be converted to.
Source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more
Source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
Context
.Source§impl<Component> ToResolvedValue for Value<Component>where
Component: ToResolvedValue,
impl<Component> ToResolvedValue for Value<Component>where
Component: ToResolvedValue,
Source§type ResolvedValue = Value<<Component as ToResolvedValue>::ResolvedValue>
type ResolvedValue = Value<<Component as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
Source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
Source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.