pub enum NetEvent {
PeerConnected {
peer: u16,
user_id: String,
route: Route,
is_host: bool,
},
Quality {
peer: u16,
user_id: String,
route: Route,
rtt_ms: Option<f64>,
loss_pct: f64,
jitter_ms: Option<f64>,
},
PeerDisconnected {
peer: u16,
user_id: String,
reason: String,
},
RelayRefused {
peer: u16,
user_id: String,
},
Closed {
reason: String,
},
}Expand description
What happened to the network since the last Net::poll_events.
Variants§
PeerConnected
A link to user_id is up. peer is the number to send to.
Quality
The link’s measured quality moved: a new route, a round trip that changed by more than 20 %, or loss crossing 2 % or 10 %.
Fields
PeerDisconnected
The link to user_id is gone: the player left, the lobby closed, or
every attempt to connect failed.
RelayRefused
No direct path to user_id, and the relay was refused by
NetOptions::allow_relay on one side.
Closed
The desktop app closed the network: the play session ended, the lobby
closed, the app quit, or Net::close was called.
Trait Implementations§
impl StructuralPartialEq for NetEvent
Auto Trait Implementations§
impl Freeze for NetEvent
impl RefUnwindSafe for NetEvent
impl Send for NetEvent
impl Sync for NetEvent
impl Unpin for NetEvent
impl UnsafeUnpin for NetEvent
impl UnwindSafe for NetEvent
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