#[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) -> 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 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) -> Self
fn from(c: CardinalDirection) -> Self
Converts to this type from the input type.
Source§impl From<OrdinalDirection> for Direction
impl From<OrdinalDirection> for Direction
Source§fn from(o: OrdinalDirection) -> Self
fn from(o: OrdinalDirection) -> Self
Converts to this type from the input type.
Source§impl<T> Index<Direction> for DirectionTable<T>
impl<T> Index<Direction> for DirectionTable<T>
Source§impl<T> IndexMut<Direction> for DirectionTable<T>
impl<T> IndexMut<Direction> for DirectionTable<T>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)