[][src]Struct libp2p_core::nodes::collection::CollectionReachEvent

#[must_use = "The node reached event is used to accept the newly-opened connection"]
pub struct CollectionReachEvent<'a, TInEvent: 'a, TOutEvent: 'a, THandler: 'a, TReachErr, THandlerErr: 'a> { /* fields omitted */ }

Event that happens when we reach a node.

Methods

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>
[src]

pub fn peer_id(&self) -> &PeerId
[src]

Returns the peer id of the node that has been reached.

pub fn reach_attempt_id(&self) -> ReachAttemptId
[src]

Returns the reach attempt that reached the node.

pub fn would_replace(&self) -> bool
[src]

Returns true if accepting this reached node would replace an existing connection to that node.

pub fn accept(self) -> (CollectionNodeAccept, PeerId)
[src]

Accepts the new node.

pub fn deny(self) -> PeerId
[src]

Denies the node.

Has the same effect as dropping the event without accepting it.

Trait Implementations

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> Drop for CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>
[src]

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> Debug for CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>
[src]

Auto Trait Implementations

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> Send for CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> where
    THandler: Send,
    THandlerErr: Send,
    TInEvent: Send,
    TOutEvent: Send,
    TReachErr: Send

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr> !Sync for CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T