use std::sync::Arc; use tokio::sync::RwLock; use futures::stream::SplitSink; use hyper::upgrade::Upgraded; use hyper_util::rt::TokioIo; use tokio_tungstenite::{tungstenite::Message, WebSocketStream}; use crate::app::{ authentication::AuthToken, context::Context, }; type StreamType = Arc>, Message>>>; #[derive(Clone)] pub struct Connection { pub bus:u32, pub stream:StreamType, pub auth:Option, pub context:Context, pub prev:u32, pub next:u32, }