pub enum DhtNetworkEvent {
PeerDiscovered {
peer_id: PeerId,
dht_key: Key,
},
PeerDisconnected {
peer_id: PeerId,
},
KClosestPeersChanged {
old: Vec<PeerId>,
new: Vec<PeerId>,
},
PeerAdded {
peer_id: PeerId,
},
PeerRemoved {
peer_id: PeerId,
},
RoutingTableReady {
num_peers: usize,
},
BootstrapComplete {
num_peers: usize,
},
OperationCompleted {
operation: String,
success: bool,
duration: Duration,
},
NetworkStatusChanged {
connected_peers: usize,
routing_table_size: usize,
},
Error {
error: String,
},
}Expand description
DHT network events
Variants§
PeerDiscovered
New DHT peer discovered
PeerDisconnected
DHT peer disconnected
KClosestPeersChanged
The K-closest peers to this node’s own address have changed.
Emitted after routing table mutations (peer added, removed, or evicted) when the set of K-closest peers differs from the previous snapshot. Callers implementing replication can use this to detect close-group topology changes and trigger neighbor-sync or responsibility recomputation.
Fields
PeerAdded
New peer added to the routing table.
PeerRemoved
Peer removed from the routing table (swap-out, eviction, or departure).
RoutingTableReady
Routing table populated after bootstrap peer discovery.
Emitted when the DHT routing table is populated with peers from the bootstrap process. This is an intermediate milestone — the node has outbound connectivity and can issue DHT queries, but it has not yet classified its own reachability or acquired a relay if private.
For the “fully addressable” signal, wait for Self::BootstrapComplete.
BootstrapComplete
Bootstrap fully complete: node is classified and addressable.
Emitted after the ADR-014 reachability classifier has run and, if needed, a relay has been acquired. When a consumer sees this event the node’s published DHT self-record is accurate (either a verified Direct address or a relay-allocated address).
OperationCompleted
DHT operation completed
NetworkStatusChanged
DHT network status changed
Error
Error occurred
Trait Implementations§
Source§impl Clone for DhtNetworkEvent
impl Clone for DhtNetworkEvent
Source§fn clone(&self) -> DhtNetworkEvent
fn clone(&self) -> DhtNetworkEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more