pub struct DirectionVec<C> {
pub direction: Direction,
pub magnitude: C,
}
Fields§
§direction: Direction
§magnitude: C
Implementations§
Source§impl<C> DirectionVec<C>
impl<C> DirectionVec<C>
pub fn unit(direction: Direction) -> Selfwhere
C: One,
pub fn as_ref(&self) -> DirectionVec<&C>
pub fn as_mut(&mut self) -> DirectionVec<&mut C>
pub fn map<F, C0>(self, mapper: F) -> DirectionVec<C0>where
F: FnOnce(C) -> C0,
pub fn with_mangitude<C0>(&self, new_magnitude: C0) -> DirectionVec<C0>
pub fn mov(self, target: CoordPair<C>) -> CoordPair<C>
Source§impl<'a, C> DirectionVec<&'a C>
impl<'a, C> DirectionVec<&'a C>
pub fn copied(self) -> DirectionVec<C>where
C: Copy,
pub fn cloned(self) -> DirectionVec<C>where
C: Clone,
pub fn checked_move(self, target: &CoordPair<C>) -> Option<CoordPair<C>>
pub fn checked_move_by_ref(self, target: CoordPair<&C>) -> Option<CoordPair<C>>
pub fn saturating_move(self, target: &CoordPair<C>) -> CoordPair<C>
pub fn saturating_move_by_ref(self, target: CoordPair<&C>) -> CoordPair<C>
Source§impl<'a, C> DirectionVec<&'a mut C>
impl<'a, C> DirectionVec<&'a mut C>
pub fn copied(self) -> DirectionVec<C>where
C: Copy,
pub fn cloned(self) -> DirectionVec<C>where
C: Clone,
Trait Implementations§
Source§impl<C: Clone> Clone for DirectionVec<C>
impl<C: Clone> Clone for DirectionVec<C>
Source§fn clone(&self) -> DirectionVec<C>
fn clone(&self) -> DirectionVec<C>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<C: Debug> Debug for DirectionVec<C>
impl<C: Debug> Debug for DirectionVec<C>
Source§impl<C: Hash> Hash for DirectionVec<C>
impl<C: Hash> Hash for DirectionVec<C>
Source§impl<C: Ord> Ord for DirectionVec<C>
impl<C: Ord> Ord for DirectionVec<C>
Source§fn cmp(&self, other: &DirectionVec<C>) -> Ordering
fn cmp(&self, other: &DirectionVec<C>) -> Ordering
1.21.0 · Source§fn 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
Source§impl<C: PartialEq> PartialEq for DirectionVec<C>
impl<C: PartialEq> PartialEq for DirectionVec<C>
Source§impl<C: PartialOrd> PartialOrd for DirectionVec<C>
impl<C: PartialOrd> PartialOrd for DirectionVec<C>
impl<C: Copy> Copy for DirectionVec<C>
impl<C: Eq> Eq for DirectionVec<C>
impl<C> StructuralPartialEq for DirectionVec<C>
Auto Trait Implementations§
impl<C> Freeze for DirectionVec<C>where
C: Freeze,
impl<C> RefUnwindSafe for DirectionVec<C>where
C: RefUnwindSafe,
impl<C> Send for DirectionVec<C>where
C: Send,
impl<C> Sync for DirectionVec<C>where
C: Sync,
impl<C> Unpin for DirectionVec<C>where
C: Unpin,
impl<C> UnwindSafe for DirectionVec<C>where
C: UnwindSafe,
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