pub trait Soapy: Sized {
type RawSoa: RawSoa<Self>;
}
pub trait RawSoa<T>: Copy + Clone {
type Slices<'a>
where
Self: 'a;
type SlicesMut<'a>
where
Self: 'a;
type Ref<'a>
where
Self: 'a;
type RefMut<'a>
where
Self: 'a;
fn dangling() -> Self;
unsafe fn slices(&self, start: usize, end: usize) -> Self::Slices<'_>;
unsafe fn slices_mut(&mut self, start: usize, end: usize) -> Self::SlicesMut<'_>;
fn as_ptr(self) -> *mut u8;
unsafe fn from_parts(ptr: *mut u8, capacity: usize) -> Self;
unsafe fn alloc(capacity: usize) -> Self;
unsafe fn realloc_grow(&mut self, old_capacity: usize, new_capacity: usize, length: usize);
unsafe fn realloc_shrink(&mut self, old_capacity: usize, new_capacity: usize, length: usize);
unsafe fn dealloc(self, old_capacity: usize);
unsafe fn copy(&mut self, src: usize, dst: usize, count: usize);
unsafe fn set(&mut self, index: usize, element: T);
unsafe fn get(&self, index: usize) -> T;
unsafe fn get_ref<'a>(&self, index: usize) -> Self::Ref<'a>;
unsafe fn get_mut<'a>(&self, index: usize) -> Self::RefMut<'a>;
}