Struct style::properties_and_values::value::Value

source ·
pub struct Value<Component> {
    pub(crate) v: ValueInner<Component>,
    url_data: UrlExtraData,
}
Expand description

A struct for a single specified registered custom property value that includes its original URL

Fields§

§v: ValueInner<Component>

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<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.

source§

impl Value<GenericValueComponent<Length, Number, Percentage, LengthPercentage, Color, GenericImage<GenericGradient<LineDirection, LengthPercentage, NonNegative<Length>, NonNegative<LengthPercentage>, GenericPosition<PositionComponent<HorizontalPositionKeyword>, PositionComponent<VerticalPositionKeyword>>, Angle, AngleOrPercentage, Color>, CssUrl, Color, Percentage, Resolution>, CssUrl, Integer, Angle, Time, Resolution, GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>>>

source

pub fn compute<'i, 't>( input: &mut CSSParser<'i, 't>, registration: &PropertyRegistrationData, url_data: &UrlExtraData, context: &Context<'_>, allow_computationally_dependent: AllowComputationallyDependent, ) -> Result<ComputedValue, ()>

Convert a registered custom property to a Computed custom property value, given input and a property registration.

source

pub fn parse<'i, 't>( input: &mut CSSParser<'i, 't>, syntax: &Descriptor, url_data: &UrlExtraData, allow_computationally_dependent: AllowComputationallyDependent, ) -> Result<Self, StyleParseError<'i>>

Parse and validate a registered custom property value according to its syntax descriptor, and check for computational independence.

source§

impl Value<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>>>>

source

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

source

fn to_declared_value(&self) -> CustomDeclarationValue

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.

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

source§

fn eq(&self, other: &Value<Component>) -> bool

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

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

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

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

source§

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

Convert a computed value to specified value form. Read more
source§

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> ToCss for Value<Component>
where Component: ToCss,

source§

fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Result
where 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> ToResolvedValue for Value<Component>
where Component: ToResolvedValue,

source§

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

Convert a resolved value to resolved value form.
source§

fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue

Convert a resolved value to a resolved value.
source§

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

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<Component> UnwindSafe for Value<Component>
where Component: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> MaybeBoxed<Box<T>> for T

source§

fn maybe_boxed(self) -> Box<T>

Convert
source§

impl<T> MaybeBoxed<T> for T

source§

fn maybe_boxed(self) -> T

Convert
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T