#[repr(u8)]
pub enum Direction {
North,
NorthEast,
East,
SouthEast,
South,
SouthWest,
West,
NorthWest,
}
Variants
North
NorthEast
East
SouthEast
South
SouthWest
West
NorthWest
Implementations
sourceimpl Direction
impl Direction
pub fn from_unit_coord(coord: Coord) -> Self
pub fn opposite(self) -> Direction
pub fn coord(self) -> Coord
pub fn left90(self) -> Direction
pub fn right90(self) -> Direction
pub fn left45(self) -> Direction
pub fn right45(self) -> Direction
pub fn left135(self) -> Direction
pub fn right135(self) -> Direction
pub fn bitmap_raw(self) -> u8
pub fn bitmap(self) -> DirectionBitmap
pub fn is_cardinal(self) -> bool
pub fn is_ordinal(self) -> bool
pub fn typ(self) -> DirectionType
pub fn cardinal(self) -> Option<CardinalDirection>
pub fn ordinal(self) -> Option<OrdinalDirection>
Trait Implementations
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 From<OrdinalDirection> for Direction
impl From<OrdinalDirection> for Direction
sourcefn from(o: OrdinalDirection) -> Self
fn from(o: OrdinalDirection) -> Self
Converts to this type from the input type.
sourceimpl Ord for Direction
impl Ord for Direction
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 PartialOrd<Direction> for Direction
impl PartialOrd<Direction> for Direction
sourcefn partial_cmp(&self, other: &Direction) -> Option<Ordering>
fn partial_cmp(&self, other: &Direction) -> 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 Direction
impl Eq for Direction
impl StructuralEq for Direction
impl StructuralPartialEq for Direction
Auto Trait Implementations
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnwindSafe for Direction
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