use dbx_core::connection::AppState; use std::collections::{HashMap, HashSet}; use std::path::PathBuf; use std::sync::Arc; use tokio::sync::{broadcast, Mutex, RwLock}; pub struct LoginRateLimit { pub fail_count: u32, pub locked_until: Option, } pub struct WebState { pub app: Arc, pub data_dir: PathBuf, pub password_hash: RwLock>, pub sessions: RwLock>, pub sse_channels: RwLock>>, pub login_rate_limit: Mutex, } impl WebState { pub async fn remove_sse_channel(&self, id: &str) { self.sse_channels.write().await.remove(id); } }