[][src]Enum libp2p::kad::KademliaEvent

pub enum KademliaEvent {
    BootstrapResult(Result<BootstrapOk, BootstrapError>),
    GetClosestPeersResult(Result<GetClosestPeersOk, GetClosestPeersError>),
    GetProvidersResult(Result<GetProvidersOk, GetProvidersError>),
    StartProvidingResult(Result<AddProviderOk, AddProviderError>),
    RepublishProviderResult(Result<AddProviderOk, AddProviderError>),
    GetRecordResult(Result<GetRecordOk, GetRecordError>),
    PutRecordResult(Result<PutRecordOk, PutRecordError>),
    RepublishRecordResult(Result<PutRecordOk, PutRecordError>),
    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 [Kademlia::poll].

Variants

BootstrapResult(Result<BootstrapOk, BootstrapError>)

The result of [Kademlia::bootstrap].

The result of [Kademlia::get_closest_peers].

The result of [Kademlia::get_providers].

StartProvidingResult(Result<AddProviderOk, AddProviderError>)

The result of [Kademlia::start_providing].

RepublishProviderResult(Result<AddProviderOk, AddProviderError>)

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

GetRecordResult(Result<GetRecordOk, GetRecordError>)

The result of [Kademlia::get_record].

PutRecordResult(Result<PutRecordOk, PutRecordError>)

The result of [Kademlia::put_record].

RepublishRecordResult(Result<PutRecordOk, PutRecordError>)

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>,