dacquiri 0.5.1

An authorization framework with compile-time enforcement.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use thiserror::Error;
use dacquiri::prelude::ConstraintError;

#[derive(Error, Debug)]
pub enum AuthorizationError {
    #[error("User is not enabled.")]
    UserNotEnabled,
    #[error("General error occurred.")]
    GeneralError,
}

impl From<ConstraintError> for AuthorizationError {
    fn from(_: ConstraintError) -> Self {
        AuthorizationError::GeneralError
    }
}