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,
},
PeerIdentified {
peer_id: PeerId,
fingerprint: String,
},
InboundDial {
peer_id: PeerId,
fingerprint: String,
address: Multiaddr,
},
RelayReservationEstablished {
address: Multiaddr,
},
}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.
PeerIdentified
Phase A: Identify has completed for peer_id and we’ve decoded
their Ed25519 fingerprint. Fired for every peer (inbound or
outbound) so the app layer can populate known_peers.fingerprint
and mark previously-dialed peers as trusted=1.
InboundDial
Phase A: an unknown peer has dialed us (listener side) and their
Identify just landed. The peer is NOT yet in our gossipsub
explicit-peers set — the app layer must respond with either
AcceptInbound or RejectInbound (or let the 15s TUI timeout
auto-reject).
RelayReservationEstablished
Phase D: a /p2p-circuit reservation on a configured relay
succeeded — peers across the internet can now dial us via this
circuit address. Fires when libp2p emits NewListenAddr for an
address with /p2p-circuit/ in its path.
Trait Implementations§
Source§impl Clone for NetworkEvent
impl Clone for NetworkEvent
Source§fn clone(&self) -> NetworkEvent
fn clone(&self) -> NetworkEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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>
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>
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