Enum direction::CardinalDirection
source · #[repr(u8)]
pub enum CardinalDirection {
North,
East,
South,
West,
}
Variants
North
East
South
West
Implementations
sourceimpl CardinalDirection
impl CardinalDirection
pub fn from_unit_coord(coord: Coord) -> Self
pub fn direction(self) -> Direction
pub fn opposite(self) -> CardinalDirection
pub fn coord(self) -> Coord
pub fn left90(self) -> CardinalDirection
pub fn right90(self) -> CardinalDirection
pub fn left45(self) -> OrdinalDirection
pub fn right45(self) -> OrdinalDirection
pub fn left135(self) -> OrdinalDirection
pub fn right135(self) -> OrdinalDirection
Trait Implementations
sourceimpl Clone for CardinalDirection
impl Clone for CardinalDirection
sourcefn clone(&self) -> CardinalDirection
fn clone(&self) -> CardinalDirection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CardinalDirection
impl Debug for CardinalDirection
sourceimpl From<CardinalDirection> for [i32; 2]
impl From<CardinalDirection> for [i32; 2]
sourcefn from(c: CardinalDirection) -> [i32; 2]
fn from(c: CardinalDirection) -> [i32; 2]
Converts to this type from the input type.
sourceimpl From<CardinalDirection> for (i32, i32)
impl From<CardinalDirection> for (i32, i32)
sourcefn from(c: CardinalDirection) -> (i32, i32)
fn from(c: CardinalDirection) -> (i32, i32)
Converts to this type from the input type.
sourceimpl From<CardinalDirection> for Direction
impl From<CardinalDirection> for Direction
sourcefn from(c: CardinalDirection) -> Self
fn from(c: CardinalDirection) -> Self
Converts to this type from the input type.
sourceimpl Hash for CardinalDirection
impl Hash for CardinalDirection
sourceimpl Ord for CardinalDirection
impl Ord for CardinalDirection
sourcefn cmp(&self, other: &CardinalDirection) -> Ordering
fn cmp(&self, other: &CardinalDirection) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<CardinalDirection> for CardinalDirection
impl PartialEq<CardinalDirection> for CardinalDirection
sourcefn eq(&self, other: &CardinalDirection) -> bool
fn eq(&self, other: &CardinalDirection) -> bool
sourceimpl PartialOrd<CardinalDirection> for CardinalDirection
impl PartialOrd<CardinalDirection> for CardinalDirection
sourcefn partial_cmp(&self, other: &CardinalDirection) -> Option<Ordering>
fn partial_cmp(&self, other: &CardinalDirection) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for CardinalDirection
impl Eq for CardinalDirection
impl StructuralEq for CardinalDirection
impl StructuralPartialEq for CardinalDirection
Auto Trait Implementations
impl RefUnwindSafe for CardinalDirection
impl Send for CardinalDirection
impl Sync for CardinalDirection
impl Unpin for CardinalDirection
impl UnwindSafe for CardinalDirection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more