You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
393 B
20 lines
393 B
2 years ago
|
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}
|
||
|
}
|
||
|
}
|