pub enum ToRelay {
Hello(Hello),
ListRooms,
Host {
room: Option<String>,
password: Option<String>,
},
Join {
room: String,
password: Option<String>,
},
Leave,
Send {
to: Option<u8>,
data: Vec<u8>,
},
Ping(u32),
Keep {
update: u64,
bytes: Vec<u8>,
},
Fetch,
Digest {
epoch: u32,
update: u64,
crc: u32,
},
}Expand description
A game to the relay.
Variants§
Hello(Hello)
The first message: who this game is.
ListRooms
The rooms open on this relay.
Host
Open a room (the code it asks for, or a new one) and be its host, player 0.
Fields
Join
Join a room.
Leave
Leave the room (the connection stays open).
Send
Data for one player, or for every other player in the room.
Fields
Ping(u32)
Is the relay there? It answers FromRelay::Pong with the same number.
Keep
The host’s town, for the server to keep (when it keeps rooms): the save made when
update updates had begun.
Fetch
The town the server keeps for this room: it answers FromRelay::Kept.
Digest
A digest of this game’s state when update updates had begun, made in epoch (the
resyncs it has been through), for the server’s check.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToRelay
impl<'de> Deserialize<'de> for ToRelay
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 ToRelay
Auto Trait Implementations§
impl Freeze for ToRelay
impl RefUnwindSafe for ToRelay
impl Send for ToRelay
impl Sync for ToRelay
impl Unpin for ToRelay
impl UnsafeUnpin for ToRelay
impl UnwindSafe for ToRelay
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