[][src]Enum libp2p_kad::kbucket::Entry

pub enum Entry<'a, TPeerId, TVal> {
    InKbucketConnected(EntryInKbucketConn<'a, TPeerId, TVal>),
    InKbucketConnectedPending(EntryInKbucketConnPending<'a, TPeerId, TVal>),
    InKbucketDisconnected(EntryInKbucketDisc<'a, TPeerId, TVal>),
    InKbucketDisconnectedPending(EntryInKbucketDiscPending<'a, TPeerId, TVal>),
    NotInKbucket(EntryNotInKbucket<'a, TPeerId, TVal>),
    SelfEntry,
}

Represents an entry or a potential entry in the k-buckets.

Variants

InKbucketConnected(EntryInKbucketConn<'a, TPeerId, TVal>)

Entry in a k-bucket that we're connected to.

InKbucketConnectedPending(EntryInKbucketConnPending<'a, TPeerId, TVal>)

Entry pending waiting for a free slot to enter a k-bucket. We're connected to it.

InKbucketDisconnected(EntryInKbucketDisc<'a, TPeerId, TVal>)

Entry in a k-bucket but that we're not connected to.

InKbucketDisconnectedPending(EntryInKbucketDiscPending<'a, TPeerId, TVal>)

Entry pending waiting for a free slot to enter a k-bucket. We're not connected to it.

NotInKbucket(EntryNotInKbucket<'a, TPeerId, TVal>)

Entry is not present in any k-bucket.

SelfEntry

Entry is the local peer ID.

Methods

impl<'a, TPeerId, TVal> Entry<'a, TPeerId, TVal> where
    TPeerId: KBucketsPeerId + Clone
[src]

pub fn value(&mut self) -> Option<&mut TVal>[src]

Returns the value associated to the entry in the bucket, including if the node is pending.

pub fn value_not_pending(&mut self) -> Option<&mut TVal>[src]

Returns the value associated to the entry in the bucket.

Auto Trait Implementations

impl<'a, TPeerId, TVal> Send for Entry<'a, TPeerId, TVal> where
    TPeerId: Send + Sync,
    TVal: Send

impl<'a, TPeerId, TVal> Sync for Entry<'a, TPeerId, TVal> where
    TPeerId: Sync,
    TVal: Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Same for T

type Output = T

Should always be Self

impl<T> Erased for T