pub enum NetworkEvent {
PeerDiscovered {
peer_id: PeerId,
},
PeerExpired {
peer_id: PeerId,
},
RoomAnnouncementReceived(RoomAnnouncement),
RoomMessageReceived {
room_id: String,
payload: Vec<u8>,
from_peer: PeerId,
},
ListeningOn {
address: Multiaddr,
},
DialSucceeded {
peer_id: PeerId,
address: Multiaddr,
},
DialFailed {
address: Multiaddr,
error: String,
},
}Variants§
PeerDiscovered
A peer was discovered on the LAN (mDNS).
PeerExpired
A peer’s mDNS record expired.
RoomAnnouncementReceived(RoomAnnouncement)
A room was announced on the global rooms topic.
RoomMessageReceived
A raw message arrived on a per-room topic. Payload is the
JSON-encoded RoomMessage — decoded by the app layer.
ListeningOn
DialSucceeded
A user-initiated dial to address succeeded — the remote peer
is peer_id and the swarm now has an open connection.
DialFailed
A user-initiated dial failed before establishing a connection.
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 (const: unstable) · 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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