[][src]Enum libp2p::kad::kbucket::Entry

pub enum Entry<'a, TPeerId, TVal> where
    TPeerId: 'a,
    TVal: 'a, 
{ 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<TPeerId> + 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> From<T> for T[src]

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

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

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.