pub struct Vec2<T> {
pub x: T,
pub y: T,
}Expand description
A 2D vector (or position).
Fields§
§x: T§y: TImplementations§
Trait Implementations§
source§impl<T> AddAssign for Vec2<T>where
T: AddAssign,
impl<T> AddAssign for Vec2<T>where
T: AddAssign,
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl<'de, T> Deserialize<'de> for Vec2<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Vec2<T>where
T: Deserialize<'de>,
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<T> DivAssign<T> for Vec2<T>
impl<T> DivAssign<T> for Vec2<T>
source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moresource§impl<T> MulAssign<T> for Vec2<T>
impl<T> MulAssign<T> for Vec2<T>
source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moresource§impl<T> SubAssign for Vec2<T>where
T: SubAssign,
impl<T> SubAssign for Vec2<T>where
T: SubAssign,
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl<T: Copy> Copy for Vec2<T>
impl<T: Eq> Eq for Vec2<T>
impl<T> StructuralPartialEq for Vec2<T>
Auto Trait Implementations§
impl<T> Freeze for Vec2<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vec2<T>where
T: RefUnwindSafe,
impl<T> Send for Vec2<T>where
T: Send,
impl<T> Sync for Vec2<T>where
T: Sync,
impl<T> Unpin for Vec2<T>where
T: Unpin,
impl<T> UnwindSafe for Vec2<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
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)