24 lines
424 B
Rust
24 lines
424 B
Rust
use tokio::net::TcpStream;
|
|
use tokio_tungstenite::WebSocketStream;
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
pub struct Network {
|
|
pub stream: NetworkConnection,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct NetworkConnection {
|
|
conn_id: u64,
|
|
stream: WebSocketStream<TcpStream>,
|
|
}
|
|
|
|
impl PartialEq for NetworkConnection {
|
|
fn eq(&self, other: &Self) -> bool {
|
|
self.conn_id == other.conn_id
|
|
}
|
|
}
|
|
|
|
impl NetworkConnection {
|
|
//TODO Recv/Send wrappers
|
|
}
|