rustchat/src/chat_user.rs

20 lines
393 B
Rust
Raw Normal View History

2021-12-31 02:05:32 +01:00
use std::net::TcpStream;
/// Represent one single chat user and their network stuff
pub struct ChatUser {
/// user id
pub id: u64,
/// Name of the chat user
pub name: String,
/// TCPStream socket object thingy
pub socket: TcpStream,
}
impl ChatUser {
pub fn new(id: u64, name: String, socket: TcpStream) -> Self {
Self{id, name, socket}
}
}