pub enum CollectionEvent<'a, TInEvent: 'a, TOutEvent: 'a, THandler: 'a, TReachErr, THandlerErr> {
    NodeReached(CollectionReachEvent<'a, TInEvent, TOutEvent, THandler, TReachErr, THandlerErr>),
    NodeClosed {
        peer_id: PeerId,
    },
    NodeError {
        peer_id: PeerId,
        error: HandledNodeError<THandlerErr>,
    },
    ReachError {
        id: ReachAttemptId,
        error: TReachErr,
        handler: THandler,
    },
    NodeEvent {
        peer_id: PeerId,
        event: TOutEvent,
    },
}
Expand description

Event that can happen on the CollectionStream.

Variants

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

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

NodeClosed

Fields

peer_id: PeerId

Identifier of the node.

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.

NodeError

Fields

peer_id: PeerId

Identifier of the node.

error: HandledNodeError<THandlerErr>

The error that happened.

A connection to a node has errored.

Can only happen after a node has been successfully reached.

ReachError

Fields

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.

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

NodeEvent

Fields

peer_id: PeerId

Identifier of the node.

event: TOutEvent

The produced event.

A node has produced an event.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.