use alloc::string::String;
use core::fmt;
pub type Result<T> = core::result::Result<T, StoreError>;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum StoreError {
OutOfResources(&'static str),
Backend(String),
Poisoned(&'static str),
}
impl fmt::Display for StoreError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::OutOfResources(w) => write!(f, "durability store: out of resources: {w}"),
Self::Backend(m) => write!(f, "durability store: backend error: {m}"),
Self::Poisoned(w) => write!(f, "durability store: lock poisoned: {w}"),
}
}
}
impl core::error::Error for StoreError {}