#[repr(C)]pub struct Point<T> {
pub x: T,
pub y: T,
}
Expand description
Two dimensional point with a generic coordinate type.
Fields§
§x: T
X coordinate.
y: T
Y coordinate.
Implementations§
Trait Implementations§
source§impl<T> AddAssign for Point<T>where
T: AddAssign,
impl<T> AddAssign for Point<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<T> DivAssign<T> for Point<T>
impl<T> DivAssign<T> for Point<T>
source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/=
operation. Read moresource§impl<T> DivAssign for Point<T>where
T: DivAssign,
impl<T> DivAssign for Point<T>where
T: DivAssign,
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<T> MulAssign<T> for Point<T>
impl<T> MulAssign<T> for Point<T>
source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*=
operation. Read moresource§impl<T> MulAssign for Point<T>where
T: MulAssign,
impl<T> MulAssign for Point<T>where
T: MulAssign,
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<T> SubAssign for Point<T>where
T: SubAssign,
impl<T> SubAssign for Point<T>where
T: SubAssign,
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl<T> Zeroable for Point<T>where
T: AnyBitPattern,
impl<T> Zeroable for Point<T>where
T: AnyBitPattern,
impl<T> AnyBitPattern for Point<T>where
T: AnyBitPattern,
impl<T: Copy> Copy for Point<T>
impl<T: Eq> Eq for Point<T>
impl<T> NoUninit for Point<T>where
T: NoUninit,
SAFETY: This trait has four preconditions:
- All fields in the struct must implement
NoUninit
- The struct must be
#[repr(C)]
or#[repr(transparent)]
- The struct must not contain any padding bytes
- The struct must contain no generic parameters
We satisfy the first and second preconditions trivially. The third condition is satisfied because the struct is repr(C) and contains two fields of the same type which guarantees no padding.
The fourth condition is obviously not satisfied which is what requires implementing this trait manually rather than deriving it. This condition only exists because the bytemuck derive macro cannot guarantee the first three conditions in a type with generic parameters.
impl<T> StructuralPartialEq for Point<T>
Auto Trait Implementations§
impl<T> Freeze for Point<T>where
T: Freeze,
impl<T> RefUnwindSafe for Point<T>where
T: RefUnwindSafe,
impl<T> Send for Point<T>where
T: Send,
impl<T> Sync for Point<T>where
T: Sync,
impl<T> Unpin for Point<T>where
T: Unpin,
impl<T> UnwindSafe for Point<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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.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
)