zero4rs 2.0.0

zero4rs is a powerful, pragmatic, and extremely fast web framework for Rust
Documentation
use std::{
    collections::HashMap,
    sync::{atomic::AtomicUsize, Arc},
};

use tokio::sync::mpsc;

use super::UserInfo;
use crate::core::websocat::echo::{command::Command, ConnId, Msg};

pub struct EchoServer {
    /// Tracks total number of historical connections established.
    pub visitor_count: Arc<AtomicUsize>,

    /// Command receiver.
    pub cmd_rx: mpsc::UnboundedReceiver<Command>,
    pub ctx: actix_web::web::Data<crate::server::AppContext>,

    /// Map of connection IDs to their message receivers.
    pub sessions: HashMap<ConnId, (mpsc::UnboundedSender<Msg>, Option<String>)>, // connid, tx, user_id

    pub users: HashMap<String, (UserInfo, ConnId)>, // user_id and user_info

    /// Map of connection IDs to their subscribe channels.
    pub subscribes: HashMap<ConnId, Vec<String>>,
}