pub struct Vec2<T = usize> {
pub x: T,
pub y: T,
}Fields§
§x: T§y: TImplementations§
Source§impl<T: Copy> Vec2<T>
impl<T: Copy> Vec2<T>
Sourcepub const fn in_orientation(&self, orientation: Orientation) -> T
pub const fn in_orientation(&self, orientation: Orientation) -> T
Gets the x if Orientation::Horizontal else y
Source§impl Vec2
impl Vec2
pub const fn saturating_sub(self, other: Self) -> Self
Trait Implementations§
Source§impl<T: AddAssign<T>> AddAssign for Vec2<T>
impl<T: AddAssign<T>> AddAssign for Vec2<T>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreimpl<T: Copy> Copy for Vec2<T>
impl<T: Eq> Eq for Vec2<T>
Source§impl<T: Ord> Ord for Vec2<T>
impl<T: Ord> Ord for Vec2<T>
1.21.0 (const: unstable) · 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<T: PartialOrd> PartialOrd for Vec2<T>
impl<T: PartialOrd> PartialOrd 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> UnsafeUnpin for Vec2<T>where
T: UnsafeUnpin,
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