pub unsafe trait Slots {
type Index: Copy + Eq;
type Physical: Copy + Eq + Into<Self::Index>;
type Capacity: Copy
+ IntoIterator<Item = Self::Index, IntoIter: DoubleEndedIterator + ExactSizeIterator>;
type Data: Copy + Into<usize>;
const MAX: usize;
fn offset(index: Self::Index) -> usize;
fn count(capacity: Self::Capacity) -> usize;
unsafe fn nth(capacity: Self::Capacity, ordinal: usize) -> Self::Index;
}
pub unsafe trait Batch {
type Event;
const MAX: usize;
fn as_slice(&self) -> &[Self::Event];
}
unsafe impl<T, const N: usize> Batch for [T; N] {
type Event = T;
const MAX: usize = N;
fn as_slice(&self) -> &[T] {
self
}
}