persistence + proper disconnect
This commit is contained in:
@@ -11,20 +11,20 @@ pub const BINCODE_CONFIG: Configuration = bincode::config::standard();
|
||||
|
||||
#[derive(Debug, bincode::Encode, bincode::Decode)]
|
||||
pub enum ClientMsg {
|
||||
SendMsg(Msg),
|
||||
SendMsg(NetMsg),
|
||||
RequestMsgs,
|
||||
}
|
||||
|
||||
#[derive(Debug, bincode::Encode, bincode::Decode)]
|
||||
pub enum ServerMsg {
|
||||
SendMsg(Msg),
|
||||
LoadMsgs(Vec<Msg>),
|
||||
SendMsg(NetMsg),
|
||||
LoadMsgs(Vec<NetMsg>),
|
||||
}
|
||||
|
||||
pub type ServerResp<T> = Result<T, String>;
|
||||
|
||||
#[derive(Debug, Clone, bincode::Encode, bincode::Decode)]
|
||||
pub struct Msg {
|
||||
pub struct NetMsg {
|
||||
pub content: String,
|
||||
pub user: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user