25 lines
573 B
Rust
25 lines
573 B
Rust
use std::sync::Arc;
|
|
|
|
use axum::extract::FromRef;
|
|
|
|
use crate::admin::state::AdminRegistry;
|
|
use crate::service::templates;
|
|
|
|
#[derive(Clone)]
|
|
pub struct AppState {
|
|
pub templates: templates::Templates,
|
|
pub admin: Arc<AdminRegistry>,
|
|
}
|
|
|
|
impl FromRef<AppState> for templates::Templates {
|
|
fn from_ref(app_state: &AppState) -> templates::Templates {
|
|
app_state.templates.clone()
|
|
}
|
|
}
|
|
|
|
impl FromRef<AppState> for Arc<AdminRegistry> {
|
|
fn from_ref(app_state: &AppState) -> Arc<AdminRegistry> {
|
|
app_state.admin.clone()
|
|
}
|
|
}
|