use core::{error::Error, fmt};
#[derive(Debug)]
pub enum ArenaError {
OutOfSystemMemory,
KeyOutOfBounds,
NotEnoughKeys,
AliasingPairAccess,
}
impl Error for ArenaError {}
impl fmt::Display for ArenaError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let s = match self {
Self::OutOfSystemMemory => "ran out of system memory",
Self::KeyOutOfBounds => "encounteded out of bounds key",
Self::NotEnoughKeys => "ran out of valid keys",
Self::AliasingPairAccess => "tried to access aliasing item pair",
};
f.write_str(s)
}
}