Added bytemuck for Unit and Quaternion.
This commit is contained in:
parent
c667b1f9c8
commit
1c0891bbbb
|
@ -30,6 +30,12 @@ pub struct Unit<T> {
|
|||
pub(crate) value: T,
|
||||
}
|
||||
|
||||
#[cfg(feature = "bytemuck")]
|
||||
unsafe impl<T> bytemuck::Zeroable for Unit<T> where T: bytemuck::Zeroable {}
|
||||
|
||||
#[cfg(feature = "bytemuck")]
|
||||
unsafe impl<T> bytemuck::Pod for Unit<T> where T: bytemuck::Pod {}
|
||||
|
||||
#[cfg(feature = "serde-serialize")]
|
||||
impl<T: Serialize> Serialize for Unit<T> {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
|
|
|
@ -40,6 +40,12 @@ impl<N: Scalar + Zero> Default for Quaternion<N> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "bytemuck")]
|
||||
unsafe impl<N: Scalar> bytemuck::Zeroable for Quaternion<N> where Vector4<N>: bytemuck::Zeroable {}
|
||||
|
||||
#[cfg(feature = "bytemuck")]
|
||||
unsafe impl<N: Scalar> bytemuck::Pod for Quaternion<N> where Vector4<N>: bytemuck::Pod, N: Copy {}
|
||||
|
||||
#[cfg(feature = "abomonation-serialize")]
|
||||
impl<N: Scalar> Abomonation for Quaternion<N>
|
||||
where
|
||||
|
|
Loading…
Reference in New Issue