pub struct Vector2<T: Num> {
pub x: T,
pub y: T,
}Expand description
Fields§
§x: TDistance along the x axis
y: TDistance along the y axis
Trait Implementations§
Source§impl<T: Num + CheckedAdd> CheckedAdd for Vector2<T>
impl<T: Num + CheckedAdd> CheckedAdd for Vector2<T>
Source§fn checked_add(&self, rhs: &Self) -> Option<Self>
fn checked_add(&self, rhs: &Self) -> Option<Self>
Adds two numbers, checking for overflow. If overflow happens,
None is
returned.Source§impl<T: Num + CheckedSub> CheckedSub for Vector2<T>
impl<T: Num + CheckedSub> CheckedSub for Vector2<T>
Source§fn checked_sub(&self, rhs: &Self) -> Option<Self>
fn checked_sub(&self, rhs: &Self) -> Option<Self>
Subtracts two numbers, checking for underflow. If underflow happens,
None is returned.Source§impl<T: PartialOrd + Num> PartialOrd for Vector2<T>
impl<T: PartialOrd + Num> PartialOrd for Vector2<T>
Source§impl<T: Float> Positional<T> for Vector2<T>
impl<T: Float> Positional<T> for Vector2<T>
Source§impl<T: Float + TrigConsts> TwoDimensionalConsts<T> for Vector2<T>
impl<T: Float + TrigConsts> TwoDimensionalConsts<T> for Vector2<T>
impl<T: Copy + Num> Copy for Vector2<T>
impl<T: Eq + Num> Eq for Vector2<T>
impl<T: Num> StructuralPartialEq for Vector2<T>
Auto Trait Implementations§
impl<T> Freeze for Vector2<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vector2<T>where
T: RefUnwindSafe,
impl<T> Send for Vector2<T>where
T: Send,
impl<T> Sync for Vector2<T>where
T: Sync,
impl<T> Unpin for Vector2<T>where
T: Unpin,
impl<T> UnwindSafe for Vector2<T>where
T: 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