#[non_exhaustive]pub enum Transform {
Translate(Length, Length),
Scale(f32, f32),
Rotate(Angle),
Skew(Angle, Angle),
Matrix(Affine),
}Expand description
Represents a single CSS transform operation
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Translate(Length, Length)
Translates an element along the X-axis and Y-axis by the specified lengths
Scale(f32, f32)
Scales an element by the specified factors
Rotate(Angle)
Rotates an element (2D rotation) by angle in degrees
Skew(Angle, Angle)
Skews an element by the specified angles
Matrix(Affine)
Applies raw affine matrix values
Trait Implementations§
impl Copy for Transform
Source§impl<'i> FromCss<'i> for Transform
impl<'i> FromCss<'i> for Transform
Source§const VALID_TOKENS: &'static [CssToken]
const VALID_TOKENS: &'static [CssToken]
Returns the list of valid CSS tokens for this type.
Source§fn from_css(parser: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
fn from_css(parser: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
Parses the type from a
Parser instance.Source§fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
Helper function to parse the type from a string.
Source§const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
Message template used when building parse errors for this type.
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnsafeUnpin for Transform
impl UnwindSafe for Transform
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