merge develop into master #20

Merged
michael-bailey merged 181 commits from develop into master 2023-12-01 21:48:28 +00:00
2 changed files with 11 additions and 9 deletions
Showing only changes of commit cf16991f01 - Show all commits

View File

@ -3,34 +3,34 @@ use serde::{Deserialize, Serialize};
use uuid::Uuid;
/// # ClientMessage
/// This enum defined the message that a client can receive from the server
/// This enum defined the message that the server will receive from a client
/// This uses the serde library to transform to and from json.
///
#[derive(Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum ClientStreamIn {
Connected,
Update,
SendMessage { to: Uuid, content: String },
SendGlobalMessage { content: String },
Disconnect,
}
/// This enum defined the message that the server will send to a client
/// This uses the serde library to transform to and from json.
#[derive(Serialize, Deserialize, Debug)]
#[serde(tag = "type")]
pub enum ClientStreamOut {
Connected,
ConnectedClients { clients: Vec<ClientDetails> },
UserMessage { from: Uuid, content: String },
GlobalMessage { from: Uuid, content: String },
ConnectedClients { clients: Vec<ClientDetails> },
Disconnected,
Connected,
// error cases
Error,
}

View File

@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use uuid::Uuid;
/// Message the server will receive from a socket
#[derive(Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum NetworkSockIn {
@ -12,6 +13,7 @@ pub enum NetworkSockIn {
},
}
/// Message the server will send through a socket
#[derive(Serialize, Deserialize, Debug)]
#[serde(tag = "type")]
pub enum NetworkSockOut {