pub enum NetworkEvent {
PeerConnected {
peer_id: PeerId,
},
PeerDisconnected {
peer_id: PeerId,
},
MessageReceived {
peer_id: PeerId,
request_id: Option<RequestId>,
data: Vec<u8>,
},
BroadcastReceived {
peer_id: PeerId,
data: Vec<u8>,
},
NewListenAddr {
addr: Multiaddr,
},
ExternalAddrConfirmed {
addr: Multiaddr,
},
RoomPeerJoined {
peer_id: PeerId,
},
RoomPeerLeft {
peer_id: PeerId,
},
StatsUpdated {
total_peers: usize,
},
}Expand description
Events emitted by the network backend, translated from raw P2P events.
Variants§
PeerConnected
PeerDisconnected
MessageReceived
A direct message was received from a peer (request-response). request_id is set for request-response protocols so the coordinator can reply. For simple direct sends without a response channel, request_id may be None.
BroadcastReceived
A broadcast message was received from the room topic (pubsub / gossip).
NewListenAddr
ExternalAddrConfirmed
RoomPeerJoined
A new peer joined the active room topic.
RoomPeerLeft
A peer left the active room topic.
StatsUpdated
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 moreAuto Trait Implementations§
impl Freeze for NetworkEvent
impl RefUnwindSafe for NetworkEvent
impl Send for NetworkEvent
impl Sync for NetworkEvent
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more