#[repr(u8)]pub enum Rotation {
Up = 0,
Right = 1,
Down = 2,
Left = 3,
}Expand description
the possible rotation states of a object
Variants§
Implementations§
Source§impl Rotation
impl Rotation
Sourcepub const fn ch(self) -> char
pub const fn ch(self) -> char
character of this rot (Right => >, Up => ^, Left => <, Down => v)
Sourcepub const fn mirrored(self, horizontally: bool, vertically: bool) -> Self
pub const fn mirrored(self, horizontally: bool, vertically: bool) -> Self
mirror the directions.
Sourcepub const fn rotated_180(self) -> Self
pub const fn rotated_180(self) -> Self
rotate 180
Sourcepub fn rotate_180(&mut self)
pub fn rotate_180(&mut self)
rotate 180 in place
Trait Implementations§
impl 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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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