[][src]Enum libp2p_kad::KademliaEvent

pub enum KademliaEvent {
    BootstrapResult(BootstrapResult),
    GetClosestPeersResult(GetClosestPeersResult),
    GetProvidersResult(GetProvidersResult),
    StartProvidingResult(AddProviderResult),
    RepublishProviderResult(AddProviderResult),
    GetRecordResult(GetRecordResult),
    PutRecordResult(PutRecordResult),
    RepublishRecordResult(PutRecordResult),
    Discovered {
        peer_id: PeerId,
        addresses: Vec<Multiaddr>,
        ty: KadConnectionType,
    },
    RoutingUpdated {
        peer: PeerId,
        addresses: Addresses,
        old_peer: Option<PeerId>,
    },
    UnroutablePeer {
        peer: PeerId,
    },
}

The events produced by the Kademlia behaviour.

See NetworkBehaviour::poll.

Variants

BootstrapResult(BootstrapResult)

The result of Kademlia::bootstrap.

GetClosestPeersResult(GetClosestPeersResult)
GetProvidersResult(GetProvidersResult)

The result of Kademlia::get_providers.

StartProvidingResult(AddProviderResult)
RepublishProviderResult(AddProviderResult)

The result of a (automatic) republishing of a provider record.

GetRecordResult(GetRecordResult)

The result of Kademlia::get_record.

PutRecordResult(PutRecordResult)

The result of Kademlia::put_record.

RepublishRecordResult(PutRecordResult)

The result of a (automatic) republishing of a (value-)record.

Discovered

A peer has been discovered during a query.

Fields of Discovered

peer_id: PeerId

The ID of the discovered peer.

addresses: Vec<Multiaddr>

The known addresses of the discovered peer.

ty: KadConnectionType

The connection status reported by the discovered peer towards the local peer.

RoutingUpdated

The routing table has been updated.

Fields of RoutingUpdated

peer: PeerId

The ID of the peer that was added or updated.

addresses: Addresses

The list of known addresses of peer.

old_peer: Option<PeerId>

The ID of the peer that was evicted from the routing table to make room for the new peer, if any.

UnroutablePeer

A peer has connected for whom no listen address is known.

If the peer is to be added to the local node's routing table, a known listen address for the peer must be provided via Kademlia::add_address.

Fields of UnroutablePeer

peer: PeerId

Trait Implementations

impl Debug for KademliaEvent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,