use axum::extract::FromRef; use sqlx::PgPool; use crate::config::Config; #[derive(Clone)] pub struct AppState { pub pool: PgPool, pub config: Config, } impl FromRef for PgPool { fn from_ref(state: &AppState) -> Self { state.pool.clone() } } impl FromRef for Config { fn from_ref(state: &AppState) -> Self { state.config.clone() } }