ACCOUNT CREATION AND LOGIN
This commit is contained in:
@@ -3,13 +3,15 @@ use super::data::*;
|
||||
#[derive(Debug)]
|
||||
pub enum ClientMsg {
|
||||
CreateAccount(CreateAccount),
|
||||
Login(Login),
|
||||
RequestMsgs,
|
||||
SendMsg(SendMsg),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ServerMsg {
|
||||
CreateAccount(CreateAccountResp),
|
||||
CreateAccountResp(CreateAccountResp),
|
||||
LoginResp(LoginResp),
|
||||
LoadMsg(LoadMsg),
|
||||
LoadMsgs(Vec<LoadMsg>),
|
||||
ServerError(ServerError),
|
||||
@@ -21,6 +23,8 @@ 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;
|
||||
|
||||
impl From<CreateAccount> for ClientMsg {
|
||||
@@ -29,6 +33,12 @@ impl From<CreateAccount> for ClientMsg {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Login> for ClientMsg {
|
||||
fn from(value: Login) -> Self {
|
||||
Self::Login(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ServerError> for ServerMsg {
|
||||
fn from(value: ServerError) -> Self {
|
||||
Self::ServerError(value)
|
||||
@@ -43,6 +53,12 @@ impl From<LoadMsg> for ServerMsg {
|
||||
|
||||
impl From<CreateAccountResp> for ServerMsg {
|
||||
fn from(value: CreateAccountResp) -> Self {
|
||||
Self::CreateAccount(value)
|
||||
Self::CreateAccountResp(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<LoginResp> for ServerMsg {
|
||||
fn from(value: LoginResp) -> Self {
|
||||
Self::LoginResp(value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user