use std::sync::Arc; use crate::{ auth::SessionManager, cache::IsrCache, health::HealthChecker, http::HttpClient, icon_cache::IconCache, tarpit::TarpitState, }; /// Application state shared across all handlers #[derive(Clone)] pub struct AppState { pub client: HttpClient, pub health_checker: Arc, pub tarpit_state: Arc, pub pool: sqlx::PgPool, pub session_manager: Arc, pub isr_cache: Arc, pub icon_cache: Arc, } /// Errors that can occur during proxying to Bun #[derive(Debug)] pub enum ProxyError { Network(reqwest::Error), } impl std::fmt::Display for ProxyError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { ProxyError::Network(e) => write!(f, "Network error: {e}"), } } } impl std::error::Error for ProxyError {}