pub trait Store: 'static {}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum StoreError {
Missing { type_name: &'static str },
ExpiredScope,
BorrowConflict { type_name: &'static str },
}
impl std::fmt::Display for StoreError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Missing { type_name } => write!(f, "no provider for store {type_name}"),
Self::ExpiredScope => f.write_str("store scope is not mounted or has expired"),
Self::BorrowConflict { type_name } => {
write!(f, "store {type_name} is already borrowed")
}
}
}
}
impl std::error::Error for StoreError {}