#[repr(C, u8)]
pub enum GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero, LengthPercentage: Zero + ZeroNoPercent, Number: PartialEq,
{
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>

source

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.

source

fn animate_mismatched_transforms( left: &[Self], right: &[Self], procedure: Procedure, ) -> Result<Self, ()>

source§

impl GenericTransformOperation<Angle, f32, CSSPixelLength, i32, LengthPercentage>

source

pub fn to_translate_3d(&self) -> Self

Convert to a Translate3D.

Must be called on a Translate function

source

pub fn to_rotate_3d(&self) -> Self

Convert to a Rotate3D.

Must be called on a Rotate function.

source

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>
where Angle: Zero, LengthPercentage: Zero + ZeroNoPercent, Number: PartialEq,

source

pub fn is_rotate(&self) -> bool

Check if it is any rotate function.

source

pub fn is_translate(&self) -> bool

Check if it is any translate function

source

pub fn is_scale(&self) -> bool

Check if it is any scale function

Trait Implementations§

source§

impl<Angle, Number, Length: Clone, Integer: Clone, LengthPercentage> Clone for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero + Clone, LengthPercentage: Zero + ZeroNoPercent + Clone, Number: PartialEq + Clone,

source§

fn clone( &self, ) -> GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>

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<Angle, Number, Length: Debug, Integer: Debug, LengthPercentage> Debug for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero + Debug, LengthPercentage: Zero + ZeroNoPercent + Debug, Number: PartialEq + Debug,

source§

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

Formats the value using the given formatter. Read more
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>,

source§

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

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl<Angle, Number, Length: PartialEq, Integer: PartialEq, LengthPercentage> PartialEq for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero + PartialEq, LengthPercentage: Zero + ZeroNoPercent + PartialEq, Number: PartialEq + PartialEq,

source§

fn eq( &self, other: &GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>, ) -> 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<Angle, Number, Length, Integer, LengthPercentage> Serialize for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero + Serialize, LengthPercentage: Zero + ZeroNoPercent + Serialize, Number: PartialEq + Serialize, Length: Serialize, Integer: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Angle, Number, Length, Integer, LengthPercentage> SpecifiedValueInfo for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>

source§

const SUPPORTED_TYPES: u8 = 0u8

Supported CssTypes by the given value type. Read more
source§

fn collect_completion_keywords(_f: &mut dyn FnMut(&[&'static str]))

Collect value starting words for the given specified value type. This includes keyword and function names which can appear at the beginning of a value of this type. Read more
source§

impl<Angle, Number, Length, Integer, LengthPercentage> ToAnimatedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>

§

type AnimatedValue = GenericTransformOperation<<Angle as ToAnimatedValue>::AnimatedValue, <Number as ToAnimatedValue>::AnimatedValue, <Length as ToAnimatedValue>::AnimatedValue, <Integer as ToAnimatedValue>::AnimatedValue, <LengthPercentage as ToAnimatedValue>::AnimatedValue>

The type of the animated value.
source§

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

Converts this value to an animated value.
source§

impl<Angle, Number, Length, Integer, LengthPercentage> ToComputedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>

§

type ComputedValue = GenericTransformOperation<<Angle as ToComputedValue>::ComputedValue, <Number as ToComputedValue>::ComputedValue, <Length as ToComputedValue>::ComputedValue, <Integer as ToComputedValue>::ComputedValue, <LengthPercentage 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<Angle, Number, Length, Integer, LengthPercentage> ToCss for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero + ToCss, LengthPercentage: Zero + ZeroNoPercent + ToCss, Number: PartialEq + ToCss, Length: ToCss, Integer: 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<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>, ()>

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§

fn is_3d(&self) -> bool

Check if it is a 3d transform function.
source§

impl<Angle, Number, Length, Integer, LengthPercentage> ToResolvedValue for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>

§

type ResolvedValue = GenericTransformOperation<<Angle as ToResolvedValue>::ResolvedValue, <Number as ToResolvedValue>::ResolvedValue, <Length as ToResolvedValue>::ResolvedValue, <Integer as ToResolvedValue>::ResolvedValue, <LengthPercentage 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<Angle, Number, Length, Integer, LengthPercentage> ToShmem for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero + ToShmem, LengthPercentage: Zero + ZeroNoPercent + ToShmem, Number: PartialEq + ToShmem, Length: ToShmem, Integer: 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<Angle, Number, Length, Integer, LengthPercentage> StructuralPartialEq for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Zero, LengthPercentage: Zero + ZeroNoPercent, Number: PartialEq,

Auto Trait Implementations§

§

impl<Angle, Number, Length, Integer, LengthPercentage> Freeze for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Freeze, LengthPercentage: Freeze, Length: Freeze, Number: Freeze, Integer: Freeze,

§

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>
where Angle: Send, LengthPercentage: Send, Length: Send, Number: Send, Integer: Send,

§

impl<Angle, Number, Length, Integer, LengthPercentage> Sync for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Sync, LengthPercentage: Sync, Length: Sync, Number: Sync, Integer: Sync,

§

impl<Angle, Number, Length, Integer, LengthPercentage> Unpin for GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>
where Angle: Unpin, LengthPercentage: Unpin, Length: Unpin, Number: Unpin, Integer: Unpin,

§

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

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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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

§

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

§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

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

source§

impl<T> MaybeSendSync for T