stuff
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use super::data::*;
|
||||
use super::data;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ClientMsg {
|
||||
@@ -6,6 +6,7 @@ pub enum ClientMsg {
|
||||
Login(Login),
|
||||
RequestMsgs,
|
||||
SendMsg(SendMsg),
|
||||
RequestUsers(RequestUsers),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -15,17 +16,23 @@ pub enum ServerMsg {
|
||||
LoadMsg(LoadMsg),
|
||||
LoadMsgs(Vec<LoadMsg>),
|
||||
ServerError(ServerError),
|
||||
RequestUsersResp(RequestUsersResp),
|
||||
}
|
||||
|
||||
pub type LoginKey = LoginKeyV0;
|
||||
pub type SendMsg = SendMsgV0;
|
||||
pub type LoadMsg = LoadMsgV0;
|
||||
pub type ServerError = ServerErrorV0;
|
||||
pub type CreateAccount = CreateAccountV0;
|
||||
pub type CreateAccountResp = CreateAccountRespV0;
|
||||
pub type Login = LoginV0;
|
||||
pub type LoginResp = LoginRespV0;
|
||||
pub type UserId = UserIdV0;
|
||||
// TODO: a ton of this should really just be macros :sob:
|
||||
|
||||
pub use data::CreateAccountRespV0 as CreateAccountResp;
|
||||
pub use data::CreateAccountV0 as CreateAccount;
|
||||
pub use data::LoadMsgV0 as LoadMsg;
|
||||
pub use data::LoginKeyV0 as LoginKey;
|
||||
pub use data::LoginRespV0 as LoginResp;
|
||||
pub use data::LoginV0 as Login;
|
||||
pub use data::RequestUsersRespV0 as RequestUsersResp;
|
||||
pub use data::RequestUsersV0 as RequestUsers;
|
||||
pub use data::SendMsgV0 as SendMsg;
|
||||
pub use data::ServerErrorV0 as ServerError;
|
||||
pub use data::ServerUserV0 as ServerUser;
|
||||
pub use data::UserIdV0 as UserId;
|
||||
|
||||
impl From<CreateAccount> for ClientMsg {
|
||||
fn from(value: CreateAccount) -> Self {
|
||||
@@ -39,6 +46,12 @@ impl From<Login> for ClientMsg {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RequestUsers> for ClientMsg {
|
||||
fn from(value: RequestUsers) -> Self {
|
||||
Self::RequestUsers(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ServerError> for ServerMsg {
|
||||
fn from(value: ServerError) -> Self {
|
||||
Self::ServerError(value)
|
||||
@@ -62,3 +75,9 @@ impl From<LoginResp> for ServerMsg {
|
||||
Self::LoginResp(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RequestUsersResp> for ServerMsg {
|
||||
fn from(value: RequestUsersResp) -> Self {
|
||||
Self::RequestUsersResp(value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user