pub struct NetworkEvents {
pub peers_connected: Vec<PeerId>,
pub peers_disconnected: Vec<PeerId>,
pub packets: Vec<(PeerId, Vec<u8>)>,
}Expand description
Per-frame network events, drained from the background network thread.
These vectors are populated once per frame by [NetworkHandle::poll()]
and auto-cleared at the start of the next poll cycle. This mirrors the
one-frame lifecycle of button press/release events.
Fields§
§peers_connected: Vec<PeerId>§peers_disconnected: Vec<PeerId>§packets: Vec<(PeerId, Vec<u8>)>Trait Implementations§
Source§impl Clone for NetworkEvents
impl Clone for NetworkEvents
Source§fn clone(&self) -> NetworkEvents
fn clone(&self) -> NetworkEvents
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 NetworkEvents
impl Debug for NetworkEvents
Source§impl Default for NetworkEvents
impl Default for NetworkEvents
Source§fn default() -> NetworkEvents
fn default() -> NetworkEvents
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NetworkEvents
impl RefUnwindSafe for NetworkEvents
impl Send for NetworkEvents
impl Sync for NetworkEvents
impl Unpin for NetworkEvents
impl UnsafeUnpin for NetworkEvents
impl UnwindSafe for NetworkEvents
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