aura-rs-backend / src /state.rs
nishantcoder108
feat: implement state for pgpool and config
222ad80
Raw History Blame Contribute Delete
284 Bytes
use axum::extract::FromRef;
use sqlx::PgPool;
use crate::config::AppConfig;
#[derive(Clone)]
pub struct AppState {
pub pool: PgPool,
pub config: AppConfig,
}
impl FromRef<AppState> for PgPool {
fn from_ref(state: &AppState) -> Self {
state.pool.clone()
}
}