mod iter;
pub use self::iter::*;
use crate::storage::StorageFamily;
pub trait Archetype<F: StorageFamily>: Default {
type Item;
fn ids(&self) -> impl Iterator<Item = F::Id>;
fn insert(&mut self, value: Self::Item) -> F::Id;
fn remove(&mut self, id: F::Id) -> Option<Self::Item>;
}
pub type StructOf<S> =
<<S as StructOfAble>::Struct as SplitFields<<S as StructOfAble>::Family>>::StructOf;
pub trait StructOfAble {
type Struct: SplitFields<Self::Family>;
type Family: StorageFamily;
}
pub trait SplitFields<F: StorageFamily>: Sized {
type StructOf: Archetype<F>;
}
pub trait StructRef {
type Ref<'a>;
type RefMut<'a>;
}