[][src]Enum libp2p_core::nodes::raw_swarm::RawSwarmEvent

pub enum RawSwarmEvent<'a, TTrans: 'a, TInEvent: 'a, TOutEvent: 'a, THandler: 'a, THandlerErr: 'a> where
    TTrans: Transport
{ ListenerClosed { listen_addr: Multiaddr, listener: TTrans::Listener, result: Result<(), <TTrans::Listener as Stream>::Error>, }, IncomingConnection(IncomingConnectionEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr>), IncomingConnectionError { listen_addr: Multiaddr, send_back_addr: Multiaddr, error: IncomingError<TTrans::Error>, }, Connected { peer_id: PeerId, endpoint: ConnectedPoint, }, Replaced { peer_id: PeerId, closed_endpoint: ConnectedPoint, endpoint: ConnectedPoint, }, NodeClosed { peer_id: PeerId, endpoint: ConnectedPoint, }, NodeError { peer_id: PeerId, endpoint: ConnectedPoint, error: HandledNodeError<THandlerErr>, }, DialError { remain_addrs_attempt: usize, peer_id: PeerId, multiaddr: Multiaddr, error: RawSwarmReachError<TTrans::Error>, }, UnknownPeerDialError { multiaddr: Multiaddr, error: TransportError<TTrans::Error>, handler: THandler, }, NodeEvent { peer_id: PeerId, event: TOutEvent, }, }

Event that can happen on the RawSwarm.

Variants

ListenerClosed

One of the listeners gracefully closed.

Fields of ListenerClosed

listen_addr: Multiaddr

Address of the listener which closed.

listener: TTrans::Listener

The listener which closed.

result: Result<(), <TTrans::Listener as Stream>::Error>

The error that happened. Ok if gracefully closed.

IncomingConnection(IncomingConnectionEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr>)

A new connection arrived on a listener.

IncomingConnectionError

A new connection was arriving on a listener, but an error happened when negotiating it.

This can include, for example, an error during the handshake of the encryption layer, or the connection unexpectedly closed.

Fields of IncomingConnectionError

listen_addr: Multiaddr

Address of the listener which received the connection.

send_back_addr: Multiaddr

Address used to send back data to the remote.

error: IncomingError<TTrans::Error>

The error that happened.

Connected

A new connection to a peer has been opened.

Fields of Connected

peer_id: PeerId

Id of the peer.

endpoint: ConnectedPoint

If Listener, then we received the connection. If Dial, then it's a connection that we opened.

Replaced

A connection to a peer has been replaced with a new one.

Fields of Replaced

peer_id: PeerId

Id of the peer.

closed_endpoint: ConnectedPoint

Endpoint we were connected to.

endpoint: ConnectedPoint

If Listener, then we received the connection. If Dial, then it's a connection that we opened.

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: PeerId

Identifier of the node.

endpoint: ConnectedPoint

Endpoint we were connected to.

NodeError

The handler of a node has produced an error.

Fields of NodeError

peer_id: PeerId

Identifier of the node.

endpoint: ConnectedPoint

Endpoint we were connected to.

error: HandledNodeError<THandlerErr>

The error that happened.

DialError

Failed to reach a peer that we were trying to dial.

Fields of DialError

remain_addrs_attempt: usize

Returns the number of multiaddresses that still need to be attempted. If this is non-zero, then there's still a chance we can connect to this node. If this is zero, then we have definitely failed.

peer_id: PeerId

Id of the peer we were trying to dial.

multiaddr: Multiaddr

The multiaddr we failed to reach.

error: RawSwarmReachError<TTrans::Error>

The error that happened.

UnknownPeerDialError

Failed to reach a peer that we were trying to dial.

Fields of UnknownPeerDialError

multiaddr: Multiaddr

The multiaddr we failed to reach.

error: TransportError<TTrans::Error>

The error that happened.

handler: THandler

The handler that was passed to dial().

NodeEvent

A node produced a custom event.

Fields of NodeEvent

peer_id: PeerId

Id of the node that produced the event.

event: TOutEvent

Event that was produced by the node.

Trait Implementations

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr> Debug for RawSwarmEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr> where
    TOutEvent: Debug,
    TTrans: Transport,
    TTrans::Error: Debug,
    THandlerErr: Debug
[src]

Auto Trait Implementations

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr> Send for RawSwarmEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr> where
    THandler: Send,
    THandlerErr: Send,
    TInEvent: Send,
    TOutEvent: Send,
    <TTrans as Transport>::Error: Send,
    <TTrans as Transport>::Listener: Send,
    <TTrans as Transport>::ListenerUpgrade: Send

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr> !Sync for RawSwarmEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr>

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
    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> Any for T where
    T: 'static + ?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> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T