1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
use std::io;
pub type DbResult<T> = Result<T, DbError>;
#[derive(Debug)]
pub enum DbError {
Unexpected(&'static str),
Io(io::Error),
Bincode(bincode::Error),
}
impl From<bincode::Error> for DbError {
fn from(err: bincode::Error) -> Self {
Self::Bincode(err)
}
}
impl From<io::Error> for DbError {
fn from(err: io::Error) -> Self {
Self::Io(err)
}
}