[][src]Enum libp2p_kad::KademliaOut

pub enum KademliaOut {
    Discovered {
        peer_id: PeerId,
        addresses: Vec<Multiaddr>,
        ty: KadConnectionType,
    },
    KBucketAdded {
        peer_id: PeerId,
        replaced: Option<PeerId>,
    },
    FindNodeResult {
        key: PeerId,
        closer_peers: Vec<PeerId>,
    },
    GetProvidersResult {
        key: Multihash,
        provider_peers: Vec<PeerId>,
        closer_peers: Vec<PeerId>,
    },
}

Output event of the Kademlia behaviour.

Variants

Discovered

We have discovered a node.

Note: The Kademlia behaviour doesn't store the addresses of this node, and therefore attempting to connect to this node may or may not work.

Fields of Discovered

peer_id: PeerId

Id of the node that was discovered.

addresses: Vec<Multiaddr>

Addresses of the node.

ty: KadConnectionType

How the reporter is connected to the reported.

KBucketAdded

A node has been added to a k-bucket.

Fields of KBucketAdded

peer_id: PeerId

Id of the node that was added.

replaced: Option<PeerId>

If Some, this addition replaced the value that is inside the option.

FindNodeResult

Result of a FIND_NODE iterative query.

Fields of FindNodeResult

key: PeerId

The key that we looked for in the query.

closer_peers: Vec<PeerId>

List of peers ordered from closest to furthest away.

GetProvidersResult

Result of a GET_PROVIDERS iterative query.

Fields of GetProvidersResult

key: Multihash

The key that we looked for in the query.

provider_peers: Vec<PeerId>

The peers that are providing the requested key.

closer_peers: Vec<PeerId>

List of peers ordered from closest to furthest away.

Trait Implementations

impl Clone for KademliaOut[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for KademliaOut[src]

Auto Trait Implementations

impl Send for KademliaOut

impl Sync for KademliaOut

Blanket Implementations

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T