#[repr(C, u8)]pub enum GenericTranslate<LengthPercentage, Length>{
None,
Translate(LengthPercentage, LengthPercentage, Length),
}
Expand description
A value of the translate
property
https://drafts.csswg.org/css-transforms-2/#individual-transform-serialization:
If a 2d translation is specified, the property must serialize with only one or two values (per usual, if the second value is 0px, the default, it must be omitted when serializing; however if 0% is the second value, it is included).
If a 3d translation is specified and the value can be expressed as 2d, we treat as 2d and serialize accoringly. Otherwise, we serialize all three values. https://github.com/w3c/csswg-drafts/issues/3305
https://drafts.csswg.org/css-transforms-2/#individual-transforms
Variants§
Implementations§
Trait Implementations§
source§impl<LengthPercentage, Length> Clone for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> Clone for GenericTranslate<LengthPercentage, Length>
source§fn clone(&self) -> GenericTranslate<LengthPercentage, Length>
fn clone(&self) -> GenericTranslate<LengthPercentage, Length>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<LengthPercentage, Length> Debug for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> Debug for GenericTranslate<LengthPercentage, Length>
source§impl<'de, LengthPercentage, Length> Deserialize<'de> for GenericTranslate<LengthPercentage, Length>
impl<'de, LengthPercentage, Length> Deserialize<'de> for GenericTranslate<LengthPercentage, Length>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<LengthPercentage, Length> MallocSizeOf for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> MallocSizeOf for GenericTranslate<LengthPercentage, Length>
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<LengthPercentage, Length> PartialEq for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> PartialEq for GenericTranslate<LengthPercentage, Length>
source§fn eq(&self, other: &GenericTranslate<LengthPercentage, Length>) -> bool
fn eq(&self, other: &GenericTranslate<LengthPercentage, Length>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<LengthPercentage, Length> Serialize for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> Serialize for GenericTranslate<LengthPercentage, Length>
source§impl<LengthPercentage, Length> SpecifiedValueInfo for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + SpecifiedValueInfo,
Length: Zero + SpecifiedValueInfo,
impl<LengthPercentage, Length> SpecifiedValueInfo for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + SpecifiedValueInfo,
Length: Zero + SpecifiedValueInfo,
source§const SUPPORTED_TYPES: u8 = _
const SUPPORTED_TYPES: u8 = _
Supported CssTypes by the given value type. Read more
source§impl<LengthPercentage, Length> ToAnimatedValue for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + ToAnimatedValue,
Length: Zero + ToAnimatedValue,
<LengthPercentage as ToAnimatedValue>::AnimatedValue: Zero + ZeroNoPercent,
<Length as ToAnimatedValue>::AnimatedValue: Zero,
impl<LengthPercentage, Length> ToAnimatedValue for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + ToAnimatedValue,
Length: Zero + ToAnimatedValue,
<LengthPercentage as ToAnimatedValue>::AnimatedValue: Zero + ZeroNoPercent,
<Length as ToAnimatedValue>::AnimatedValue: Zero,
§type AnimatedValue = GenericTranslate<<LengthPercentage as ToAnimatedValue>::AnimatedValue, <Length as ToAnimatedValue>::AnimatedValue>
type AnimatedValue = GenericTranslate<<LengthPercentage as ToAnimatedValue>::AnimatedValue, <Length as ToAnimatedValue>::AnimatedValue>
The type of the animated value.
source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
source§fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
Converts this value to an animated value.
source§impl<LengthPercentage, Length> ToAnimatedZero for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> ToAnimatedZero for GenericTranslate<LengthPercentage, Length>
source§fn to_animated_zero(&self) -> Result<Self, ()>
fn to_animated_zero(&self) -> Result<Self, ()>
Returns a value that, when added with an underlying value, will produce the underlying
value. This is used for SMIL animation’s “by-animation” where SMIL first interpolates from
the zero value to the ‘by’ value, and then adds the result to the underlying value. Read more
source§impl<LengthPercentage, Length> ToComputedValue for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + ToComputedValue,
Length: Zero + ToComputedValue,
<LengthPercentage as ToComputedValue>::ComputedValue: Zero + ZeroNoPercent,
<Length as ToComputedValue>::ComputedValue: Zero,
impl<LengthPercentage, Length> ToComputedValue for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + ToComputedValue,
Length: Zero + ToComputedValue,
<LengthPercentage as ToComputedValue>::ComputedValue: Zero + ZeroNoPercent,
<Length as ToComputedValue>::ComputedValue: Zero,
§type ComputedValue = GenericTranslate<<LengthPercentage as ToComputedValue>::ComputedValue, <Length as ToComputedValue>::ComputedValue>
type ComputedValue = GenericTranslate<<LengthPercentage as ToComputedValue>::ComputedValue, <Length 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<LengthPercentage, Length> ToCss for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> ToCss for GenericTranslate<LengthPercentage, Length>
source§impl<LengthPercentage, Length> ToResolvedValue for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + ToResolvedValue,
Length: Zero + ToResolvedValue,
<LengthPercentage as ToResolvedValue>::ResolvedValue: Zero + ZeroNoPercent,
<Length as ToResolvedValue>::ResolvedValue: Zero,
impl<LengthPercentage, Length> ToResolvedValue for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: Zero + ZeroNoPercent + ToResolvedValue,
Length: Zero + ToResolvedValue,
<LengthPercentage as ToResolvedValue>::ResolvedValue: Zero + ZeroNoPercent,
<Length as ToResolvedValue>::ResolvedValue: Zero,
§type ResolvedValue = GenericTranslate<<LengthPercentage as ToResolvedValue>::ResolvedValue, <Length as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericTranslate<<LengthPercentage as ToResolvedValue>::ResolvedValue, <Length 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.
source§impl<LengthPercentage, Length> ToShmem for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> ToShmem for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> StructuralPartialEq for GenericTranslate<LengthPercentage, Length>
Auto Trait Implementations§
impl<LengthPercentage, Length> Freeze for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> RefUnwindSafe for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: RefUnwindSafe,
Length: RefUnwindSafe,
impl<LengthPercentage, Length> Send for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> Sync for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> Unpin for GenericTranslate<LengthPercentage, Length>
impl<LengthPercentage, Length> UnwindSafe for GenericTranslate<LengthPercentage, Length>where
LengthPercentage: UnwindSafe,
Length: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert