1
0
Fork 0
forked from 2sys/shoutdotdev
shoutdotdev/src/app_state.rs

20 lines
443 B
Rust
Raw Normal View History

2025-02-26 13:10:50 -08:00
use axum::extract::FromRef;
use deadpool_diesel::postgres::Pool;
use oauth2::basic::BasicClient;
use crate::{sessions::PgStore, settings::Settings};
#[derive(Clone)]
pub(crate) struct AppState {
pub db_pool: Pool,
pub oauth_client: BasicClient,
pub session_store: PgStore,
pub settings: Settings,
}
impl FromRef<AppState> for PgStore {
fn from_ref(state: &AppState) -> Self {
state.session_store.clone()
}
}