pub enum PeerEvent {
Joined(PeerState),
Left(PeerState),
Updated(PeerState),
Identity(PeerState),
WsConnected(String),
WsDisconnected(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(PeerState)
A peer left the network (from Layer 3). Carries the entry’s final state (marked offline, WS down) — the registry entry is already gone when this fires, so consumers get a usable last view for cleanup (RFC 022 §7.4 / §16.4) instead of a bare id.
Updated(PeerState)
A peer’s metadata changed (IP, relay, online status, from Layer 3).
Identity(PeerState)
Durable identity was first set or rotated on a peer (RFC 022). Carries the full peer snapshot after the change.
WsConnected(String)
A WebSocket connection was established to a peer (Layer 5 — WS transport). Payload is the Tailscale stable id.
WsDisconnected(String)
A WebSocket connection was lost to a peer (Layer 5 — WS transport). Payload is the Tailscale stable id. Does not clear learned identity.
AuthRequired
Authentication is required — the URL should be shown to the user.