use crate::{key::StableKey, slot::AllocationSlotDescriptor};
pub trait AllocationPolicy {
type Error;
fn validate_key(&self, key: &StableKey) -> Result<(), Self::Error>;
fn validate_slot(
&self,
key: &StableKey,
slot: &AllocationSlotDescriptor,
) -> Result<(), Self::Error>;
fn validate_reserved_slot(
&self,
key: &StableKey,
slot: &AllocationSlotDescriptor,
) -> Result<(), Self::Error>;
}
pub trait NamespaceAuthority {
fn owns(&self, key: &StableKey) -> bool;
}
pub trait RangeAuthority {
type Error;
fn validate_slot(&self, slot: &AllocationSlotDescriptor) -> Result<(), Self::Error>;
}