//! Messages sent from the client to the server by the messenger. use serde::{Deserialize, Serialize}; /// Represents the type of message being sent between the client and the server #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub enum MessageType { /// Sent when a user joins the chat. Contains the username they wish to pick SetUsername(String), /// Sent when a user sends a message in the chat. Contains their message as /// a string UserMessage(String), }