use crate::component::ws::entities::{Connect, Disconnect, WSError, WebSocketMessage}; use actix::{Actor, Context, Handler}; #[derive(Default)] pub struct WSServer {} impl WSServer { pub fn new() -> Self { WSServer::default() } pub fn send(&self, _msg: WebSocketMessage) {} } impl Actor for WSServer { type Context = Context; fn started(&mut self, _ctx: &mut Self::Context) {} } impl Handler for WSServer { type Result = Result<(), WSError>; fn handle(&mut self, _msg: Connect, _ctx: &mut Context) -> Self::Result { Ok(()) } } impl Handler for WSServer { type Result = Result<(), WSError>; fn handle(&mut self, _msg: Disconnect, _: &mut Context) -> Self::Result { Ok(()) } } impl Handler for WSServer { type Result = (); fn handle(&mut self, _msg: WebSocketMessage, _ctx: &mut Context) -> Self::Result {} } impl actix::Supervised for WSServer { fn restarting(&mut self, _ctx: &mut Context) { tracing::warn!("restarting"); } }