#[repr(C, u8)]pub enum GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>{
Show 23 variants
Matrix(GenericMatrix<Number>),
Matrix3D(GenericMatrix3D<Number>),
Skew(Angle, Angle),
SkewX(Angle),
SkewY(Angle),
Translate(LengthPercentage, LengthPercentage),
TranslateX(LengthPercentage),
TranslateY(LengthPercentage),
TranslateZ(Length),
Translate3D(LengthPercentage, LengthPercentage, Length),
Scale(Number, Number),
ScaleX(Number),
ScaleY(Number),
ScaleZ(Number),
Scale3D(Number, Number, Number),
Rotate(Angle),
RotateX(Angle),
RotateY(Angle),
RotateZ(Angle),
Rotate3D(Number, Number, Number, Angle),
Perspective(GenericPerspectiveFunction<Length>),
InterpolateMatrix {
from_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>,
to_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>,
progress: Percentage,
},
AccumulateMatrix {
from_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>,
to_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>,
count: Integer,
},
}
Expand description
A single operation in the list of a transform
value
Variants§
Matrix(GenericMatrix<Number>)
Represents a 2D 2x3 matrix.
Matrix3D(GenericMatrix3D<Number>)
Represents a 3D 4x4 matrix.
Skew(Angle, Angle)
A 2D skew.
If the second angle is not provided it is assumed zero.
Syntax can be skew(angle) or skew(angle, angle)
SkewX(Angle)
skewX(angle)
SkewY(Angle)
skewY(angle)
Translate(LengthPercentage, LengthPercentage)
translate(x, y) or translate(x)
TranslateX(LengthPercentage)
translateX(x)
TranslateY(LengthPercentage)
translateY(y)
TranslateZ(Length)
translateZ(z)
Translate3D(LengthPercentage, LengthPercentage, Length)
translate3d(x, y, z)
Scale(Number, Number)
A 2D scaling factor.
Syntax can be scale(factor) or scale(factor, factor)
ScaleX(Number)
scaleX(factor)
ScaleY(Number)
scaleY(factor)
ScaleZ(Number)
scaleZ(factor)
Scale3D(Number, Number, Number)
scale3D(factorX, factorY, factorZ)
Rotate(Angle)
Describes a 2D Rotation.
In a 3D scene rotate(angle)
is equivalent to rotateZ(angle)
.
RotateX(Angle)
Rotation in 3D space around the x-axis.
RotateY(Angle)
Rotation in 3D space around the y-axis.
RotateZ(Angle)
Rotation in 3D space around the z-axis.
Rotate3D(Number, Number, Number, Angle)
Rotation in 3D space.
Generalization of rotateX, rotateY and rotateZ.
Perspective(GenericPerspectiveFunction<Length>)
Specifies a perspective projection matrix.
Part of CSS Transform Module Level 2 and defined at § 13.1. 3D Transform Function.
The value must be greater than or equal to zero.
InterpolateMatrix
A intermediate type for interpolation of mismatched transform lists.
Fields
from_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>
to_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>
progress: Percentage
AccumulateMatrix
A intermediate type for accumulation of mismatched transform lists.
Fields
from_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>
to_list: GenericTransform<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>
count: Integer
Implementations§
source§impl GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>
impl GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>
sourcefn try_animate_mismatched_transforms_in_place(
left: &[Self],
right: &[Self],
procedure: Procedure,
) -> Result<Self, ()>
fn try_animate_mismatched_transforms_in_place( left: &[Self], right: &[Self], procedure: Procedure, ) -> Result<Self, ()>
If there are no size dependencies, we try to animate in-place, to avoid creating deeply nested Interpolate* operations.
fn animate_mismatched_transforms( left: &[Self], right: &[Self], procedure: Procedure, ) -> Result<Self, ()>
source§impl GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>
impl GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>
sourcepub fn to_translate_3d(&self) -> Self
pub fn to_translate_3d(&self) -> Self
Convert to a Translate3D.
Must be called on a Translate function
sourcepub fn to_rotate_3d(&self) -> Self
pub fn to_rotate_3d(&self) -> Self
Convert to a Rotate3D.
Must be called on a Rotate function.
sourcepub fn to_scale_3d(&self) -> Self
pub fn to_scale_3d(&self) -> Self
Convert to a Scale3D.
Must be called on a Scale function
source§impl<Angle, Number, Length, Integer, LengthPercentage> TransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> TransformOperation<Angle, Number, Length, Integer, LengthPercentage>
Trait Implementations§
source§impl<Angle, Number, Length: Clone, Integer: Clone, LengthPercentage> Clone for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length: Clone, Integer: Clone, LengthPercentage> Clone for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
source§fn clone(
&self,
) -> GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
fn clone( &self, ) -> GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Angle, Number, Length: Debug, Integer: Debug, LengthPercentage> Debug for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length: Debug, Integer: Debug, LengthPercentage> Debug for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
source§impl<'de, Angle, Number, Length, Integer, LengthPercentage> Deserialize<'de> for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + Deserialize<'de>,
LengthPercentage: Zero + ZeroNoPercent + Deserialize<'de>,
Number: PartialEq + Deserialize<'de>,
Length: Deserialize<'de>,
Integer: Deserialize<'de>,
impl<'de, Angle, Number, Length, Integer, LengthPercentage> Deserialize<'de> for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + Deserialize<'de>,
LengthPercentage: Zero + ZeroNoPercent + Deserialize<'de>,
Number: PartialEq + Deserialize<'de>,
Length: Deserialize<'de>,
Integer: Deserialize<'de>,
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>,
source§impl<Angle, Number, Length, Integer, LengthPercentage> MallocSizeOf for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + MallocSizeOf,
LengthPercentage: Zero + ZeroNoPercent + MallocSizeOf,
Number: PartialEq + MallocSizeOf,
Length: MallocSizeOf,
Integer: MallocSizeOf,
impl<Angle, Number, Length, Integer, LengthPercentage> MallocSizeOf for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + MallocSizeOf,
LengthPercentage: Zero + ZeroNoPercent + MallocSizeOf,
Number: PartialEq + MallocSizeOf,
Length: MallocSizeOf,
Integer: MallocSizeOf,
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl<Angle, Number, Length: PartialEq, Integer: PartialEq, LengthPercentage> PartialEq for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length: PartialEq, Integer: PartialEq, LengthPercentage> PartialEq for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
source§fn eq(
&self,
other: &GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>,
) -> bool
fn eq( &self, other: &GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>, ) -> bool
self
and other
values to be equal, and is used by ==
.source§impl<Angle, Number, Length, Integer, LengthPercentage> Serialize for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> Serialize for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
source§impl<Angle, Number, Length, Integer, LengthPercentage> SpecifiedValueInfo for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + SpecifiedValueInfo,
LengthPercentage: Zero + ZeroNoPercent + SpecifiedValueInfo,
Number: PartialEq + SpecifiedValueInfo,
Length: SpecifiedValueInfo,
Integer: SpecifiedValueInfo,
impl<Angle, Number, Length, Integer, LengthPercentage> SpecifiedValueInfo for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + SpecifiedValueInfo,
LengthPercentage: Zero + ZeroNoPercent + SpecifiedValueInfo,
Number: PartialEq + SpecifiedValueInfo,
Length: SpecifiedValueInfo,
Integer: SpecifiedValueInfo,
source§const SUPPORTED_TYPES: u8 = 0u8
const SUPPORTED_TYPES: u8 = 0u8
source§impl<Angle, Number, Length, Integer, LengthPercentage> ToAnimatedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + ToAnimatedValue,
LengthPercentage: Zero + ZeroNoPercent + ToAnimatedValue,
Number: PartialEq + ToAnimatedValue,
<Angle as ToAnimatedValue>::AnimatedValue: Zero,
<LengthPercentage as ToAnimatedValue>::AnimatedValue: Zero + ZeroNoPercent,
<Number as ToAnimatedValue>::AnimatedValue: PartialEq,
Length: ToAnimatedValue,
Integer: ToAnimatedValue,
impl<Angle, Number, Length, Integer, LengthPercentage> ToAnimatedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + ToAnimatedValue,
LengthPercentage: Zero + ZeroNoPercent + ToAnimatedValue,
Number: PartialEq + ToAnimatedValue,
<Angle as ToAnimatedValue>::AnimatedValue: Zero,
<LengthPercentage as ToAnimatedValue>::AnimatedValue: Zero + ZeroNoPercent,
<Number as ToAnimatedValue>::AnimatedValue: PartialEq,
Length: ToAnimatedValue,
Integer: ToAnimatedValue,
source§type AnimatedValue = GenericTransformOperation<<Angle as ToAnimatedValue>::AnimatedValue, <Number as ToAnimatedValue>::AnimatedValue, <Length as ToAnimatedValue>::AnimatedValue, <Integer as ToAnimatedValue>::AnimatedValue, <LengthPercentage as ToAnimatedValue>::AnimatedValue>
type AnimatedValue = GenericTransformOperation<<Angle as ToAnimatedValue>::AnimatedValue, <Number as ToAnimatedValue>::AnimatedValue, <Length as ToAnimatedValue>::AnimatedValue, <Integer as ToAnimatedValue>::AnimatedValue, <LengthPercentage as ToAnimatedValue>::AnimatedValue>
source§fn from_animated_value(from: Self::AnimatedValue) -> Self
fn from_animated_value(from: Self::AnimatedValue) -> Self
source§fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, context: &Context<'_>) -> Self::AnimatedValue
source§impl<Angle, Number, Length, Integer, LengthPercentage> ToComputedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + ToComputedValue,
LengthPercentage: Zero + ZeroNoPercent + ToComputedValue,
Number: PartialEq + ToComputedValue,
<Angle as ToComputedValue>::ComputedValue: Zero,
<LengthPercentage as ToComputedValue>::ComputedValue: Zero + ZeroNoPercent,
<Number as ToComputedValue>::ComputedValue: PartialEq,
Length: ToComputedValue,
Integer: ToComputedValue,
impl<Angle, Number, Length, Integer, LengthPercentage> ToComputedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + ToComputedValue,
LengthPercentage: Zero + ZeroNoPercent + ToComputedValue,
Number: PartialEq + ToComputedValue,
<Angle as ToComputedValue>::ComputedValue: Zero,
<LengthPercentage as ToComputedValue>::ComputedValue: Zero + ZeroNoPercent,
<Number as ToComputedValue>::ComputedValue: PartialEq,
Length: ToComputedValue,
Integer: ToComputedValue,
source§type ComputedValue = GenericTransformOperation<<Angle as ToComputedValue>::ComputedValue, <Number as ToComputedValue>::ComputedValue, <Length as ToComputedValue>::ComputedValue, <Integer as ToComputedValue>::ComputedValue, <LengthPercentage as ToComputedValue>::ComputedValue>
type ComputedValue = GenericTransformOperation<<Angle as ToComputedValue>::ComputedValue, <Number as ToComputedValue>::ComputedValue, <Length as ToComputedValue>::ComputedValue, <Integer as ToComputedValue>::ComputedValue, <LengthPercentage as ToComputedValue>::ComputedValue>
source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Context
.source§impl<Angle, Number, Length, Integer, LengthPercentage> ToCss for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> ToCss for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
source§impl<Angle, Number, Length, Integer, LoP> ToMatrix for TransformOperation<Angle, Number, Length, Integer, LoP>where
Angle: Zero + ToRadians + Copy,
Number: PartialEq + Copy + Into<f32> + Into<f64>,
Length: ToAbsoluteLength,
LoP: Zero + ToAbsoluteLength + ZeroNoPercent,
impl<Angle, Number, Length, Integer, LoP> ToMatrix for TransformOperation<Angle, Number, Length, Integer, LoP>where
Angle: Zero + ToRadians + Copy,
Number: PartialEq + Copy + Into<f32> + Into<f64>,
Length: ToAbsoluteLength,
LoP: Zero + ToAbsoluteLength + ZeroNoPercent,
source§fn to_3d_matrix(
&self,
reference_box: Option<&Rect<ComputedLength>>,
) -> Result<Transform3D<f64>, ()>
fn to_3d_matrix( &self, reference_box: Option<&Rect<ComputedLength>>, ) -> Result<Transform3D<f64>, ()>
If |reference_box| is None, we will drop the percent part from translate because we cannot resolve it without the layout info, for computed TransformOperation. However, for specified TransformOperation, we will return Err(()) if there is any relative lengths because the only caller, DOMMatrix, doesn’t accept relative lengths.
source§impl<Angle, Number, Length, Integer, LengthPercentage> ToResolvedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + ToResolvedValue,
LengthPercentage: Zero + ZeroNoPercent + ToResolvedValue,
Number: PartialEq + ToResolvedValue,
<Angle as ToResolvedValue>::ResolvedValue: Zero,
<LengthPercentage as ToResolvedValue>::ResolvedValue: Zero + ZeroNoPercent,
<Number as ToResolvedValue>::ResolvedValue: PartialEq,
Length: ToResolvedValue,
Integer: ToResolvedValue,
impl<Angle, Number, Length, Integer, LengthPercentage> ToResolvedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: Zero + ToResolvedValue,
LengthPercentage: Zero + ZeroNoPercent + ToResolvedValue,
Number: PartialEq + ToResolvedValue,
<Angle as ToResolvedValue>::ResolvedValue: Zero,
<LengthPercentage as ToResolvedValue>::ResolvedValue: Zero + ZeroNoPercent,
<Number as ToResolvedValue>::ResolvedValue: PartialEq,
Length: ToResolvedValue,
Integer: ToResolvedValue,
source§type ResolvedValue = GenericTransformOperation<<Angle as ToResolvedValue>::ResolvedValue, <Number as ToResolvedValue>::ResolvedValue, <Length as ToResolvedValue>::ResolvedValue, <Integer as ToResolvedValue>::ResolvedValue, <LengthPercentage as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericTransformOperation<<Angle as ToResolvedValue>::ResolvedValue, <Number as ToResolvedValue>::ResolvedValue, <Length as ToResolvedValue>::ResolvedValue, <Integer as ToResolvedValue>::ResolvedValue, <LengthPercentage as ToResolvedValue>::ResolvedValue>
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
source§impl<Angle, Number, Length, Integer, LengthPercentage> ToShmem for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> ToShmem for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> StructuralPartialEq for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
Auto Trait Implementations§
impl<Angle, Number, Length, Integer, LengthPercentage> Freeze for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> RefUnwindSafe for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: RefUnwindSafe,
LengthPercentage: RefUnwindSafe,
Length: RefUnwindSafe,
Number: RefUnwindSafe,
Integer: RefUnwindSafe,
impl<Angle, Number, Length, Integer, LengthPercentage> Send for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> Sync for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> Unpin for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
impl<Angle, Number, Length, Integer, LengthPercentage> UnwindSafe for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>where
Angle: UnwindSafe + RefUnwindSafe,
LengthPercentage: UnwindSafe + RefUnwindSafe,
Length: UnwindSafe + RefUnwindSafe,
Number: UnwindSafe + RefUnwindSafe,
Integer: UnwindSafe + RefUnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
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>
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