#[repr(u8)]pub enum Direction {
North = 0,
NorthEast = 1,
East = 2,
SouthEast = 3,
South = 4,
SouthWest = 5,
West = 6,
NorthWest = 7,
}Variants§
Implementations§
Source§impl Direction
impl Direction
pub fn from_unit_coord(coord: Coord) -> Direction
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 const fn bitmap_raw(self) -> u8
pub const 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>
pub const fn all() -> DirectionIter
Trait Implementations§
Source§impl From<CardinalDirection> for Direction
impl From<CardinalDirection> for Direction
Source§fn from(c: CardinalDirection) -> Direction
fn from(c: CardinalDirection) -> Direction
Converts to this type from the input type.
Source§impl From<OrdinalDirection> for Direction
impl From<OrdinalDirection> for Direction
Source§fn from(o: OrdinalDirection) -> Direction
fn from(o: OrdinalDirection) -> Direction
Converts to this type from the input type.
Source§impl Ord for Direction
impl Ord for Direction
Source§impl PartialOrd for Direction
impl PartialOrd for Direction
impl Copy for Direction
impl Eq for Direction
impl StructuralPartialEq for Direction
Auto Trait Implementations§
impl Freeze for Direction
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnwindSafe for Direction
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