use tokio::sync::watch::Receiver; use axum::extract::FromRef; use bytes::Bytes; use sqlx::PgPool; use crate::config::Config; #[derive(Clone)] pub struct AppState { pub pool: PgPool, pub config: Config, pub log_receiver: Receiver, } 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() } } impl FromRef for Receiver { fn from_ref(state: &AppState) -> Self { state.log_receiver.clone() } }