pub enum FromRelay {
Hosted {
room: String,
},
Joined {
room: String,
player: u8,
},
PeerJoined {
player: u8,
},
PeerLeft {
player: u8,
},
Data {
from: u8,
data: Vec<u8>,
},
Error {
message: String,
},
}Expand description
The relay to a game.
Variants§
Hosted
The room is open: its code (this game is player 0).
Joined
This game joined the room as player.
PeerJoined
Another player came into the room.
PeerLeft
Another player left the room.
Data
Data from a player.
Error
A request failed (no such room, …).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FromRelay
impl<'de> Deserialize<'de> for FromRelay
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
impl StructuralPartialEq for FromRelay
Auto Trait Implementations§
impl Freeze for FromRelay
impl RefUnwindSafe for FromRelay
impl Send for FromRelay
impl Sync for FromRelay
impl Unpin for FromRelay
impl UnsafeUnpin for FromRelay
impl UnwindSafe for FromRelay
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