easy-sqlite 0.4.1

Little sqlite framework
Documentation
use std::sync::PoisonError;

#[derive(Debug, PartialEq, Eq, Clone)]
pub enum DbError {
    CanNotConnect(String),
    CanNotInitTable(&'static str, String),
    NotFound(Option<String>),
    MutexError,
    DeserializationError(String),
    Other(String),
}

pub type DbResult<T> = Result<T, DbError>;

impl<T> From<PoisonError<T>> for DbError {
    fn from(_: PoisonError<T>) -> Self {
        DbError::MutexError
    }
}

impl From<rusqlite::Error> for DbError {
    fn from(src: rusqlite::Error) -> Self {
        DbError::Other(src.to_string())
    }
}