#[non_exhaustive]pub enum NamedOrientation {
R0,
ReflectVert,
ReflectHoriz,
R90,
R180,
R270,
R90Cw,
R180Cw,
R270Cw,
FlipYx,
FlipMinusYx,
}
Expand description
A named orientation.
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.
R0
No rotations or reflections.
ReflectVert
Reflect vertically (ie. about the x-axis).
ReflectHoriz
Reflect horizontally (ie. about the y-axis).
R90
Rotate 90 degrees counter-clockwise.
R180
Rotate 180 degrees counter-clockwise.
R270
Rotate 270 degrees counter-clockwise.
R90Cw
Rotate 90 degrees clockwise.
R180Cw
Rotate 180 degrees clockwise.
R270Cw
Rotate 270 degrees clockwise.
FlipYx
Flip across the line y = x.
FlipMinusYx
Flip across the line y = -x.
Implementations§
Source§impl NamedOrientation
impl NamedOrientation
Sourcepub fn all_rectangular() -> [Self; 8]
pub fn all_rectangular() -> [Self; 8]
Returns a slice of all 8 possible named rectangular orientations.
Users should not rely upon the order of the orientations returned.
Sourcepub fn into_orientation(self) -> Orientation
pub fn into_orientation(self) -> Orientation
Converts this named orientation into a regular Orientation
.
Sourcepub fn from_orientation(orientation: Orientation) -> Self
pub fn from_orientation(orientation: Orientation) -> Self
Converts the given orientation to a named orientation.
Trait Implementations§
Source§impl Clone for NamedOrientation
impl Clone for NamedOrientation
Source§fn clone(&self) -> NamedOrientation
fn clone(&self) -> NamedOrientation
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 Debug for NamedOrientation
impl Debug for NamedOrientation
Source§impl Default for NamedOrientation
impl Default for NamedOrientation
Source§fn default() -> NamedOrientation
fn default() -> NamedOrientation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NamedOrientation
impl<'de> Deserialize<'de> for NamedOrientation
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 From<NamedOrientation> for Orientation
impl From<NamedOrientation> for Orientation
Source§fn from(value: NamedOrientation) -> Self
fn from(value: NamedOrientation) -> Self
Converts to this type from the input type.
Source§impl Hash for NamedOrientation
impl Hash for NamedOrientation
Source§impl PartialEq for NamedOrientation
impl PartialEq for NamedOrientation
Source§impl Serialize for NamedOrientation
impl Serialize for NamedOrientation
impl Copy for NamedOrientation
impl Eq for NamedOrientation
impl StructuralPartialEq for NamedOrientation
Auto Trait Implementations§
impl Freeze for NamedOrientation
impl RefUnwindSafe for NamedOrientation
impl Send for NamedOrientation
impl Sync for NamedOrientation
impl Unpin for NamedOrientation
impl UnwindSafe for NamedOrientation
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