Enum caesar_core::shared::JsonPacketResponse
source · pub enum JsonPacketResponse {
Join {
size: Option<usize>,
},
Create {
id: String,
},
Leave {
index: usize,
},
Error {
message: String,
},
}Expand description
Represents a response to a JsonPacket packet.
This enum is used to represent different types of responses to a JsonPacket packet.
Variants§
Join
Fields
A response to a Join packet.
This variant is used to indicate the result of a Join packet. The size field is used to specify the number of existing users in the room.
Create
A response to a Create packet.
This variant is used to indicate the result of a Create packet. The id field is used to specify the room id.
Leave
A response to a Leave packet.
This variant is used to indicate the result of a Leave packet. The index field is used to specify the index of the user who left the room.
Error
An error response.
This variant is used to indicate an error. The message field is used to specify the error message.
Trait Implementations§
source§impl Debug for JsonPacketResponse
impl Debug for JsonPacketResponse
source§impl<'de> Deserialize<'de> for JsonPacketResponse
impl<'de> Deserialize<'de> for JsonPacketResponse
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for JsonPacketResponse
impl RefUnwindSafe for JsonPacketResponse
impl Send for JsonPacketResponse
impl Sync for JsonPacketResponse
impl Unpin for JsonPacketResponse
impl UnwindSafe for JsonPacketResponse
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more