pub enum Dir {
S,
E,
N,
W,
}Expand description
Cardinal directions enum.
Variants§
Implementations§
Source§impl Dir
impl Dir
Sourcepub const fn opposite_mut(&mut self)
pub const fn opposite_mut(&mut self)
Changes the direction to its opposite.
Sourcepub const fn rotate_ccw(self) -> Self
pub const fn rotate_ccw(self) -> Self
Returns the next direction in counter-clockwise rotation.
Sourcepub const fn rotate_ccw_mut(&mut self)
pub const fn rotate_ccw_mut(&mut self)
Changes the direction to the next one in counter-clockwise rotation.
Sourcepub const fn rotate_cw_mut(&mut self)
pub const fn rotate_cw_mut(&mut self)
Changes the direction to the next one in clockwise rotation.
Trait Implementations§
impl Copy for Dir
impl Eq for Dir
impl StructuralPartialEq for Dir
Auto Trait Implementations§
impl Freeze for Dir
impl RefUnwindSafe for Dir
impl Send for Dir
impl Sync for Dir
impl Unpin for Dir
impl UnsafeUnpin for Dir
impl UnwindSafe for Dir
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