pub enum Direction {
Up,
Left,
Down,
Right,
}Variants§
Implementations§
Source§impl Direction
impl Direction
pub const COUNT: usize = 4
pub const ALL: [Self; 4]
pub fn new(axis: Axis, order: Order) -> Self
pub fn axis(self) -> Axis
pub fn order(self) -> Order
pub fn move_unit<C>(self, target: CoordPair<C>) -> CoordPair<C>
pub fn checked_move_unit<C>(self, target: &CoordPair<C>) -> Option<CoordPair<C>>
pub fn checked_move_unit_by_ref<C>( self, target: CoordPair<&C>, ) -> Option<CoordPair<C>>
pub fn saturating_move_unit<C>(self, target: &CoordPair<C>) -> CoordPair<C>
pub fn saturating_move_unit_by_ref<C>( self, target: CoordPair<&C>, ) -> CoordPair<C>
pub fn move_by<C>(self, magnitude: C, target: CoordPair<C>) -> CoordPair<C>
pub fn checked_move_by<C>( self, magnitude: &C, target: &CoordPair<C>, ) -> Option<CoordPair<C>>
pub fn checked_move_by_ref_by<C>( self, magnitude: &C, target: CoordPair<&C>, ) -> Option<CoordPair<C>>
pub fn saturating_move_by<C>( self, magnitude: &C, target: &CoordPair<C>, ) -> CoordPair<C>
pub fn saturating_move_by_ref_by<C>( self, magnitude: &C, target: CoordPair<&C>, ) -> CoordPair<C>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Direction
impl<'de> Deserialize<'de> for Direction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Distribution<Direction> for StandardUniform
impl Distribution<Direction> for StandardUniform
Source§impl<T> Index<Direction> for DirectionMap<T>
impl<T> Index<Direction> for DirectionMap<T>
Source§impl<T> IndexMut<Direction> for DirectionMap<T>
impl<T> IndexMut<Direction> for DirectionMap<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 UnsafeUnpin 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