diff options
Diffstat (limited to 'src/features/impl_rkyv.rs')
-rw-r--r-- | src/features/impl_rkyv.rs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/features/impl_rkyv.rs b/src/features/impl_rkyv.rs index 5c6efdc..fb72e37 100644 --- a/src/features/impl_rkyv.rs +++ b/src/features/impl_rkyv.rs @@ -90,6 +90,15 @@ mod f64 { impl_rkyv!(DVec4); } +mod i16 { + use crate::{I16Vec2, I16Vec3, I16Vec4}; + use rkyv::{from_archived, to_archived, Archive, Deserialize, Fallible, Serialize}; + + impl_rkyv!(I16Vec2); + impl_rkyv!(I16Vec3); + impl_rkyv!(I16Vec4); +} + mod i32 { use crate::{IVec2, IVec3, IVec4}; use rkyv::{from_archived, to_archived, Archive, Deserialize, Fallible, Serialize}; @@ -99,6 +108,24 @@ mod i32 { impl_rkyv!(IVec4); } +mod i64 { + use crate::{I64Vec2, I64Vec3, I64Vec4}; + use rkyv::{from_archived, to_archived, Archive, Deserialize, Fallible, Serialize}; + + impl_rkyv!(I64Vec2); + impl_rkyv!(I64Vec3); + impl_rkyv!(I64Vec4); +} + +mod u16 { + use crate::{U16Vec2, U16Vec3, U16Vec4}; + use rkyv::{from_archived, to_archived, Archive, Deserialize, Fallible, Serialize}; + + impl_rkyv!(U16Vec2); + impl_rkyv!(U16Vec3); + impl_rkyv!(U16Vec4); +} + mod u32 { use crate::{UVec2, UVec3, UVec4}; use rkyv::{from_archived, to_archived, Archive, Deserialize, Fallible, Serialize}; @@ -108,6 +135,15 @@ mod u32 { impl_rkyv!(UVec4); } +mod u64 { + use crate::{U64Vec2, U64Vec3, U64Vec4}; + use rkyv::{from_archived, to_archived, Archive, Deserialize, Fallible, Serialize}; + + impl_rkyv!(U64Vec2); + impl_rkyv!(U64Vec3); + impl_rkyv!(U64Vec4); +} + #[cfg(test)] mod test { pub type DefaultSerializer = rkyv::ser::serializers::CoreSerializer<256, 256>; @@ -175,14 +211,34 @@ mod test { test_archive(&DVec3::new(1.0, 2.0, 3.0)); test_archive(&DVec4::new(1.0, 2.0, 3.0, 4.0)); + use crate::{I16Vec2, I16Vec3, I16Vec4}; + test_archive(&I16Vec2::new(-1, 2)); + test_archive(&I16Vec3::new(-1, 2, 3)); + test_archive(&I16Vec4::new(-1, 2, 3, 4)); + use crate::{IVec2, IVec3, IVec4}; test_archive(&IVec2::new(-1, 2)); test_archive(&IVec3::new(-1, 2, 3)); test_archive(&IVec4::new(-1, 2, 3, 4)); + use crate::{I64Vec2, I64Vec3, I64Vec4}; + test_archive(&I64Vec2::new(-1, 2)); + test_archive(&I64Vec3::new(-1, 2, 3)); + test_archive(&I64Vec4::new(-1, 2, 3, 4)); + + use crate::{U16Vec2, U16Vec3, U16Vec4}; + test_archive(&U16Vec2::new(1, 2)); + test_archive(&U16Vec3::new(1, 2, 3)); + test_archive(&U16Vec4::new(1, 2, 3, 4)); + use crate::{UVec2, UVec3, UVec4}; test_archive(&UVec2::new(1, 2)); test_archive(&UVec3::new(1, 2, 3)); test_archive(&UVec4::new(1, 2, 3, 4)); + + use crate::{U64Vec2, U64Vec3, U64Vec4}; + test_archive(&U64Vec2::new(1, 2)); + test_archive(&U64Vec3::new(1, 2, 3)); + test_archive(&U64Vec4::new(1, 2, 3, 4)); } } |