pub enum PeerEvent {
Joined(PeerState),
Left(String),
Updated(PeerState),
Connected(String),
Disconnected(String),
AuthRequired {
url: String,
},
}Expand description
Events emitted by the session layer when peer state changes.
Subscribers receive these via PeerRegistry::on_peer_change.
Events cover both Layer 3 discovery changes and Layer 5 connection
lifecycle changes.
Variants§
Joined(PeerState)
A new peer appeared on the network (from Layer 3).
Left(String)
A peer left the network (by stable node ID, from Layer 3).
Updated(PeerState)
A peer’s metadata changed (IP, relay, online status, from Layer 3).
Connected(String)
A WebSocket connection was established to a peer (Layer 5).
Disconnected(String)
A WebSocket connection was lost to a peer (Layer 5).
AuthRequired
Authentication is required — the URL should be shown to the user.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerEvent
impl RefUnwindSafe for PeerEvent
impl Send for PeerEvent
impl Sync for PeerEvent
impl Unpin for PeerEvent
impl UnsafeUnpin for PeerEvent
impl UnwindSafe for PeerEvent
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