pub enum NetworkEvent {
Show 13 variants
ClientConnected(ClientId),
ClientDisconnected(ClientId),
UnreliableMessage {
client_id: ClientId,
data: Vec<u8>,
},
ReliableMessage {
client_id: ClientId,
data: Vec<u8>,
},
Ping {
client_id: ClientId,
tick: u64,
},
Pong {
tick: u64,
},
Auth {
session_token: String,
},
SessionClosed(ClientId),
StreamReset(ClientId),
Fragment {
client_id: ClientId,
fragment: FragmentedEvent,
},
StressTest {
client_id: ClientId,
count: u16,
rotate: bool,
},
Spawn {
client_id: ClientId,
entity_type: u16,
x: f32,
y: f32,
rot: f32,
},
ClearWorld {
client_id: ClientId,
},
}Expand description
Events produced by GameTransport::poll_events().
Variants§
ClientConnected(ClientId)
A new client has connected and been assigned a ClientId.
ClientDisconnected(ClientId)
A client has disconnected (graceful or timeout).
UnreliableMessage
Raw unreliable data received from a client.
ReliableMessage
Raw reliable data received from a client.
Ping
A heartbeat ping from a client.
Fields
Pong
A heartbeat pong from the server.
Auth
A session authentication request from the client.
SessionClosed(ClientId)
A WebTransport session was closed by the remote or due to error.
StreamReset(ClientId)
A WebTransport stream was reset.
Fragment
A fragment of a larger message.
Fields
§
fragment: FragmentedEventThe fragment data.
StressTest
A testing command to trigger a stress test (Phase 1/Playground only).
Fields
Spawn
A testing command to spawn a specific entity (Phase 1/Playground only).
Fields
ClearWorld
A command to clear all entities from the world (Phase 1/Playground only).
Trait Implementations§
Source§impl Clone for NetworkEvent
impl Clone for NetworkEvent
Source§fn clone(&self) -> NetworkEvent
fn clone(&self) -> NetworkEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkEvent
impl Debug for NetworkEvent
Source§impl<'de> Deserialize<'de> for NetworkEvent
impl<'de> Deserialize<'de> for NetworkEvent
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
Source§impl PartialEq for NetworkEvent
impl PartialEq for NetworkEvent
Source§impl Serialize for NetworkEvent
impl Serialize for NetworkEvent
impl StructuralPartialEq for NetworkEvent
Auto Trait Implementations§
impl Freeze for NetworkEvent
impl RefUnwindSafe for NetworkEvent
impl Send for NetworkEvent
impl Sync for NetworkEvent
impl Unpin for NetworkEvent
impl UnsafeUnpin for NetworkEvent
impl UnwindSafe for NetworkEvent
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