WORKING BASIC MSG SERVER
This commit is contained in:
@@ -3,16 +3,27 @@ use bincode::config::Configuration;
|
||||
pub mod client;
|
||||
mod no_cert;
|
||||
pub mod server;
|
||||
pub mod transfer;
|
||||
|
||||
pub const SERVER_NAME: &str = "openworm";
|
||||
pub const BINCODE_CONFIG: Configuration = bincode::config::standard();
|
||||
|
||||
#[derive(Debug, bincode::Encode, bincode::Decode)]
|
||||
pub enum ClientMsg {
|
||||
SendMsg { content: String },
|
||||
SendMsg(Msg),
|
||||
RequestMsgs,
|
||||
}
|
||||
|
||||
#[derive(Debug, bincode::Encode, bincode::Decode)]
|
||||
pub enum ServerMsg {
|
||||
RecvMsg { content: String },
|
||||
SendMsg(Msg),
|
||||
LoadMsgs(Vec<Msg>),
|
||||
}
|
||||
|
||||
pub type ServerResp<T> = Result<T, String>;
|
||||
|
||||
#[derive(Debug, Clone, bincode::Encode, bincode::Decode)]
|
||||
pub struct Msg {
|
||||
pub content: String,
|
||||
pub user: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user