mod anti_storage;
mod btree_storage;
mod dense_vec_storage;
mod drain;
mod hash_map_storage;
mod masked_storage;
mod storage_wrapper;
mod vec_storage;
pub use anti_storage::AntiStorage;
pub use btree_storage::BTreeStorage;
pub use dense_vec_storage::DenseVecStorage;
pub use drain::Drain;
pub use hash_map_storage::HashMapStorage;
pub use masked_storage::MaskedStorage;
pub use storage_wrapper::StorageWrapper;
pub use vec_storage::VecStorage;
use hibitset::BitSetLike;
use crate::{entity::Index, misc::TryDefault};
pub trait Storage<T>: TryDefault {
unsafe fn get(&self, index: Index) -> &T;
unsafe fn get_mut(&mut self, index: Index) -> &mut T;
unsafe fn insert(&mut self, index: Index, value: T);
unsafe fn remove(&mut self, index: Index) -> T;
unsafe fn clean<B>(&mut self, has: B)
where
B: BitSetLike;
unsafe fn drop(&mut self, index: Index) {
self.remove(index);
}
}
pub trait DistinctStorage {}