Yoda/src/profile/identity/auth/memory/error.rs
2025-01-23 10:57:12 +02:00

20 lines
507 B
Rust

use std::fmt::{Display, Formatter, Result};
#[derive(Debug)]
pub enum Error {
Clear,
Overwrite(String),
Unexpected,
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result {
match self {
Self::Clear => write!(f, "Could not cleanup memory index"),
Self::Overwrite(key) => {
write!(f, "Overwrite attempt for existing record `{key}`")
}
Self::Unexpected => write!(f, "Unexpected error"),
}
}
}