chibiauth/src/state.rs

15 lines
257 B
Rust
Raw Permalink Normal View History

2022-12-03 13:26:51 +00:00
use axum::extract::FromRef;
use crate::database::Database;
// clone if cloneable
pub struct AppState {
database: Database,
}
impl FromRef<AppState> for Database {
fn from_ref(state: &AppState) -> Database {
state.database.clone()
}
}