[][src]Enum libp2p_core::nodes::collection::CollectionEvent

pub enum CollectionEvent<'a, TInEvent: 'a, TOutEvent: 'a, THandler: 'a, TReachErr, THandlerErr, TUserData, TPeerId> {
    NodeReached(CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId>),
    NodeClosed {
        peer_id: TPeerId,
        user_data: TUserData,
    },
    NodeError {
        peer_id: TPeerId,
        error: HandledNodeError<THandlerErr>,
        user_data: TUserData,
    },
    ReachError {
        id: ReachAttemptId,
        error: TReachErr,
        handler: THandler,
    },
    NodeEvent {
        peer: PeerMut<'a, TInEvent, TUserData, TPeerId>,
        event: TOutEvent,
    },
}

Event that can happen on the CollectionStream.

Variants

NodeReached(CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId>)

A connection to a node has succeeded. You must use the provided event in order to accept the connection.

NodeClosed

A connection to a node has been closed.

This happens once both the inbound and outbound channels are closed, and no more outbound substream attempt is pending.

Fields of NodeClosed

peer_id: TPeerId

Identifier of the node.

user_data: TUserData

User data that was passed when accepting.

NodeError

A connection to a node has errored.

Can only happen after a node has been successfully reached.

Fields of NodeError

peer_id: TPeerId

Identifier of the node.

error: HandledNodeError<THandlerErr>

The error that happened.

user_data: TUserData

User data that was passed when accepting.

ReachError

An error happened on the future that was trying to reach a node.

Fields of ReachError

id: ReachAttemptId

Identifier of the reach attempt that failed.

error: TReachErr

Error that happened on the future.

handler: THandler

The handler that was passed to add_reach_attempt.

NodeEvent

A node has produced an event.

Fields of NodeEvent

peer: PeerMut<'a, TInEvent, TUserData, TPeerId>

The node that has generated the event.

event: TOutEvent

The produced event.

Trait Implementations

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId> Debug for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId> where
    TOutEvent: Debug,
    TReachErr: Debug,
    THandlerErr: Debug,
    TPeerId: Eq + Hash + Clone + Debug,
    TUserData: Debug
[src]

Auto Trait Implementations

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId> !Send for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId>

impl<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId> !Sync for CollectionEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr, TUserData, TPeerId>

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
    U: Into<T>, 
[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> 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

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

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