From 85ed89df486858984f0936086205efc23fd32d24 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 2 Jan 2025 17:02:25 +0100 Subject: refactor(ecs): make component::Sequence return metadata as array --- ecs/src/util.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ecs/src/util.rs') diff --git a/ecs/src/util.rs b/ecs/src/util.rs index 0344e89..4ba8597 100644 --- a/ecs/src/util.rs +++ b/ecs/src/util.rs @@ -1,5 +1,18 @@ use std::ops::BitAnd; +pub trait Array: + AsRef<[Item]> + + AsMut<[Item]> + + IntoIterator + + Sortable + + sealed::Sealed +{ +} + +impl Array for [Item; CNT] {} + +impl sealed::Sealed for [Item; CNT] {} + pub trait Sortable { type Item; @@ -115,6 +128,11 @@ macro_rules! gen_mask_64 { pub(crate) use gen_mask_64; +mod sealed +{ + pub trait Sealed {} +} + #[cfg(test)] mod tests { -- cgit v1.2.3-18-g5258