Initial commit

This commit is contained in:
Simon Goller 2024-04-26 21:34:00 +02:00
commit dccfa2d4cf
19 changed files with 3156 additions and 0 deletions

21
dao/src/lib.rs Normal file
View file

@ -0,0 +1,21 @@
use std::{future::Future, sync::Arc};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum DaoError {
#[error("Database query error: {0}")]
DatabaseQueryError(#[from] Box<dyn std::error::Error>),
}
pub trait HelloDao {
fn get_hello(&self) -> impl Future<Output = Result<Arc<str>, DaoError>> + Send;
}
pub trait PermissionDao {
fn has_privilege(
&self,
user: &str,
privilege: &str,
) -> impl Future<Output = Result<bool, DaoError>> + Send;
}