Enum direction::OrdinalDirection
source · #[repr(u8)]
pub enum OrdinalDirection {
NorthEast,
SouthEast,
SouthWest,
NorthWest,
}
Variants
NorthEast
SouthEast
SouthWest
NorthWest
Implementations
sourceimpl OrdinalDirection
impl OrdinalDirection
pub fn from_unit_coord(coord: Coord) -> Self
pub fn direction(self) -> Direction
pub fn opposite(self) -> OrdinalDirection
pub fn coord(self) -> Coord
pub fn left90(self) -> OrdinalDirection
pub fn right90(self) -> OrdinalDirection
pub fn left45(self) -> CardinalDirection
pub fn right45(self) -> CardinalDirection
pub fn left135(self) -> CardinalDirection
pub fn right135(self) -> CardinalDirection
pub fn from_cardinals(a: CardinalDirection, b: CardinalDirection) -> Option<Self>
pub fn to_cardinals(self) -> (CardinalDirection, CardinalDirection)
pub fn cardinal_bitmap(self) -> DirectionBitmap
Trait Implementations
sourceimpl Clone for OrdinalDirection
impl Clone for OrdinalDirection
sourcefn clone(&self) -> OrdinalDirection
fn clone(&self) -> OrdinalDirection
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 OrdinalDirection
impl Debug for OrdinalDirection
sourceimpl From<OrdinalDirection> for [i32; 2]
impl From<OrdinalDirection> for [i32; 2]
sourcefn from(o: OrdinalDirection) -> [i32; 2]
fn from(o: OrdinalDirection) -> [i32; 2]
Converts to this type from the input type.
sourceimpl From<OrdinalDirection> for (i32, i32)
impl From<OrdinalDirection> for (i32, i32)
sourcefn from(o: OrdinalDirection) -> (i32, i32)
fn from(o: OrdinalDirection) -> (i32, i32)
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 Hash for OrdinalDirection
impl Hash for OrdinalDirection
sourceimpl<T> Index<OrdinalDirection> for OrdinalDirectionTable<T>
impl<T> Index<OrdinalDirection> for OrdinalDirectionTable<T>
sourceimpl<T> IndexMut<OrdinalDirection> for OrdinalDirectionTable<T>
impl<T> IndexMut<OrdinalDirection> for OrdinalDirectionTable<T>
sourcefn index_mut(&mut self, index: OrdinalDirection) -> &mut Self::Output
fn index_mut(&mut self, index: OrdinalDirection) -> &mut Self::Output
Performs the mutable indexing (
container[index]
) operation. Read moresourceimpl Ord for OrdinalDirection
impl Ord for OrdinalDirection
sourcefn cmp(&self, other: &OrdinalDirection) -> Ordering
fn cmp(&self, other: &OrdinalDirection) -> 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<OrdinalDirection> for OrdinalDirection
impl PartialEq<OrdinalDirection> for OrdinalDirection
sourcefn eq(&self, other: &OrdinalDirection) -> bool
fn eq(&self, other: &OrdinalDirection) -> bool
sourceimpl PartialOrd<OrdinalDirection> for OrdinalDirection
impl PartialOrd<OrdinalDirection> for OrdinalDirection
sourcefn partial_cmp(&self, other: &OrdinalDirection) -> Option<Ordering>
fn partial_cmp(&self, other: &OrdinalDirection) -> 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 OrdinalDirection
impl Eq for OrdinalDirection
impl StructuralEq for OrdinalDirection
impl StructuralPartialEq for OrdinalDirection
Auto Trait Implementations
impl RefUnwindSafe for OrdinalDirection
impl Send for OrdinalDirection
impl Sync for OrdinalDirection
impl Unpin for OrdinalDirection
impl UnwindSafe for OrdinalDirection
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