summaryrefslogtreecommitdiff
path: root/ecs/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/util.rs')
-rw-r--r--ecs/src/util.rs18
1 files changed, 18 insertions, 0 deletions
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<Item>:
+ AsRef<[Item]>
+ + AsMut<[Item]>
+ + IntoIterator<Item = Item>
+ + Sortable<Item = Item>
+ + sealed::Sealed
+{
+}
+
+impl<Item, const CNT: usize> Array<Item> for [Item; CNT] {}
+
+impl<Item, const CNT: usize> 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
{