use super::{BlockId, InactiveBlock};
#[derive(Debug, thiserror::Error)]
pub(crate) enum ReusePolicyError {
#[allow(dead_code)]
#[error("Block {0} already exists in free list")]
BlockAlreadyExists(BlockId),
#[error("Block {0} not found in free list")]
BlockNotFound(BlockId),
}
#[allow(dead_code)]
pub(crate) trait ReusePolicy: Send + Sync + std::fmt::Debug {
fn insert(&mut self, inactive_block: InactiveBlock) -> Result<(), ReusePolicyError>;
fn remove(&mut self, block_id: BlockId) -> Result<(), ReusePolicyError>;
fn next_free(&mut self) -> Option<InactiveBlock>;
fn is_empty(&self) -> bool;
fn len(&self) -> usize;
}