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

10
dao/Cargo.toml Normal file
View file

@ -0,0 +1,10 @@
[package]
name = "dao"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
thiserror = "1.0.59"
uuid = "1.8"

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;
}