pub enum Rotation {
    None = 0,
    Clockwise = 1,
    Flip = 2,
    Anticlockwise = 3,
}Expand description
Variants§
None = 0
No rotation (0°)
Clockwise = 1
Rotate 90° clockwise
Flip = 2
Rotate 180°
Anticlockwise = 3
Rotate 90° anticlockwise
Implementations§
Source§impl Rotation
 
impl Rotation
Sourcepub fn is_turn(self) -> bool
 
pub fn is_turn(self) -> bool
Check if a rotation is a turn; that is, if it is Clockwise or
Anticlockwise
§Example
use gridly::rotation::*;
assert!(!Rotation::None.is_turn());
assert!(!Rotation::Flip.is_turn());
assert!(Clockwise.is_turn());
assert!(Anticlockwise.is_turn());Sourcepub fn reverse(self) -> Self
 
pub fn reverse(self) -> Self
Get the rotation in the opposite direction. Note that Rotation::None and
Rotation::Flip are their own opposites.
§Example
use gridly::rotation::*;
assert_eq!(Rotation::None.reverse(), Rotation::None);
assert_eq!(Rotation::Flip.reverse(), Rotation::Flip);
assert_eq!(Clockwise.reverse(), Anticlockwise);
assert_eq!(Anticlockwise.reverse(), Clockwise);Trait Implementations§
Source§impl AddAssign for Rotation
 
impl AddAssign for Rotation
Source§fn add_assign(&mut self, rhs: Rotation)
 
fn add_assign(&mut self, rhs: Rotation)
Performs the 
+= operation. Read moreSource§impl SubAssign for Rotation
 
impl SubAssign for Rotation
Source§fn sub_assign(&mut self, rhs: Rotation)
 
fn sub_assign(&mut self, rhs: Rotation)
Performs the 
-= operation. Read moreimpl Copy for Rotation
impl Eq for Rotation
impl StructuralPartialEq for Rotation
Auto Trait Implementations§
impl Freeze for Rotation
impl RefUnwindSafe for Rotation
impl Send for Rotation
impl Sync for Rotation
impl Unpin for Rotation
impl UnwindSafe for Rotation
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