import FromBytes for glam types
This commit is contained in:
parent
41be55bf8d
commit
736faa3f46
@ -1,4 +1,4 @@
|
|||||||
use zerocopy::AsBytes;
|
use zerocopy::{FromBytes, AsBytes};
|
||||||
use crate::{Vec2, Vec3, Vec4, Mat2, Mat3, Mat4, Quat};
|
use crate::{Vec2, Vec3, Vec4, Mat2, Mat3, Mat4, Quat};
|
||||||
|
|
||||||
unsafe impl AsBytes for Vec2 {
|
unsafe impl AsBytes for Vec2 {
|
||||||
@ -8,6 +8,13 @@ unsafe impl AsBytes for Vec2 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl FromBytes for Vec2 {
|
||||||
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
|
where
|
||||||
|
Self: Sized {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl AsBytes for Vec3 {
|
unsafe impl AsBytes for Vec3 {
|
||||||
fn only_derive_is_allowed_to_implement_this_trait()
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
where
|
where
|
||||||
@ -15,6 +22,13 @@ unsafe impl AsBytes for Vec3 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl FromBytes for Vec3 {
|
||||||
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
|
where
|
||||||
|
Self: Sized {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl AsBytes for Vec4 {
|
unsafe impl AsBytes for Vec4 {
|
||||||
fn only_derive_is_allowed_to_implement_this_trait()
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
where
|
where
|
||||||
@ -22,6 +36,13 @@ unsafe impl AsBytes for Vec4 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl FromBytes for Vec4 {
|
||||||
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
|
where
|
||||||
|
Self: Sized {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl AsBytes for Mat2 {
|
unsafe impl AsBytes for Mat2 {
|
||||||
fn only_derive_is_allowed_to_implement_this_trait()
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
where
|
where
|
||||||
@ -29,6 +50,13 @@ unsafe impl AsBytes for Mat2 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl FromBytes for Mat2 {
|
||||||
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
|
where
|
||||||
|
Self: Sized {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl AsBytes for Mat3 {
|
unsafe impl AsBytes for Mat3 {
|
||||||
fn only_derive_is_allowed_to_implement_this_trait()
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
where
|
where
|
||||||
@ -36,6 +64,13 @@ unsafe impl AsBytes for Mat3 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl FromBytes for Mat3 {
|
||||||
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
|
where
|
||||||
|
Self: Sized {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl AsBytes for Mat4 {
|
unsafe impl AsBytes for Mat4 {
|
||||||
fn only_derive_is_allowed_to_implement_this_trait()
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
where
|
where
|
||||||
@ -43,9 +78,23 @@ unsafe impl AsBytes for Mat4 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl FromBytes for Mat4 {
|
||||||
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
|
where
|
||||||
|
Self: Sized {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl AsBytes for Quat {
|
unsafe impl AsBytes for Quat {
|
||||||
fn only_derive_is_allowed_to_implement_this_trait()
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
where
|
where
|
||||||
Self: Sized {}
|
Self: Sized {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe impl FromBytes for Quat {
|
||||||
|
fn only_derive_is_allowed_to_implement_this_trait()
|
||||||
|
where
|
||||||
|
Self: Sized {}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user