use axum::extract::FromRef; use rear::admin::state::{AdminState, SharedAdminRegistry}; use rear::service::templates; #[derive(Clone)] pub struct AppState { pub templates: templates::Templates, pub admin: SharedAdminRegistry, } impl FromRef for templates::Templates { fn from_ref(app_state: &AppState) -> templates::Templates { app_state.templates.clone() } } impl AdminState for AppState { fn get_templates(&self) -> &templates::Templates { &self.templates } fn get_registry(&self) -> SharedAdminRegistry { self.admin.clone() } }