use alloc::vec::Vec;
use crate::allocator::{SlotError, SlotHandle};
use crate::slot::{ReaderMask, SlotHeader};
pub trait SlotBackend: Send + Sync {
fn reserve_slot(&self, active_readers_mask: ReaderMask) -> Result<SlotHandle, SlotError>;
fn commit_slot(&self, handle: SlotHandle, bytes: &[u8]) -> Result<u32, SlotError>;
fn discard_slot(&self, handle: SlotHandle) -> Result<(), SlotError>;
fn read_slot(&self, handle: SlotHandle) -> Result<(SlotHeader, Vec<u8>), SlotError>;
fn mark_read(&self, handle: SlotHandle, reader_index: u8) -> Result<(), SlotError>;
fn mark_reader_disconnected(&self, reader_index: u8) -> Result<(), SlotError>;
fn slot_count(&self) -> Result<usize, SlotError>;
fn slot_total_size(&self) -> usize;
fn slot_capacity(&self) -> usize;
fn type_hash(&self) -> Option<[u8; 16]> {
None
}
}