use core::fmt;
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Error {
StaleIndex,
CapacityExceeded,
CounterOverflow,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::StaleIndex => f.write_str("stale index: handle does not refer to a live element"),
Self::CapacityExceeded => f.write_str("capacity exceeded: allocator could not grow"),
Self::CounterOverflow => {
f.write_str("counter overflow: generation or symbol counter exhausted")
}
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for Error {}
pub type Result<T> = core::result::Result<T, Error>;