From 5d3ab3dcf8deb887877523e0293237bcee804b1b Mon Sep 17 00:00:00 2001 From: stale Date: Wed, 11 May 2022 07:00:55 -0300 Subject: Ported, it woooorks --- src/types.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/types.rs') diff --git a/src/types.rs b/src/types.rs index eed69dd..73d51b8 100644 --- a/src/types.rs +++ b/src/types.rs @@ -3,10 +3,8 @@ use std::{ net::SocketAddr, sync::Arc, }; +use warp::ws::Message; use tokio::sync::RwLock; -use hyper_tungstenite::tungstenite::Message; -use hyper::{ Response, Body }; -use futures::channel::mpsc::UnboundedSender; use crate::minesweeper; #[derive(Debug, Clone)] @@ -32,12 +30,17 @@ pub enum MetaMove { #[derive(Debug)] pub struct Peer { - pub tx: UnboundedSender, + pub tx: tokio::sync::mpsc::UnboundedSender, pub seq_id: usize, pub name: String, pub position: (usize, usize), } -pub type HtmlResult = Result, Response>; -pub type MovReqTx = futures::channel::mpsc::UnboundedSender; +pub struct ConnData { + pub cmd_tx: CmdTx, + pub remote_addr: SocketAddr, + pub peers: PeerMap, +} + +pub type CmdTx = tokio::sync::mpsc::UnboundedSender; pub type PeerMap = Arc>>; -- cgit v1.2.3