#[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<'de, T> Deserialize<'de> for Point<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Point<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 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,
Available on crate feature
bytemuck
only.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
.