feat: Start dummy in-memory database
This commit is contained in:
parent
1ef02c58dd
commit
bdb5008914
9 changed files with 181 additions and 3 deletions
14
src/db/error.rs
Normal file
14
src/db/error.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use std::fmt;
|
||||
|
||||
use crate::db::UserRef;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct UserAlreadyExists(pub UserRef);
|
||||
|
||||
impl fmt::Display for UserAlreadyExists {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "User already exists: {}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for UserAlreadyExists {}
|
||||
Loading…
Reference in a new issue