[][src]Enum libp2p::core::nodes::network::NetworkEvent

pub enum NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo = PeerId, TPeerId = PeerId> where
    TTrans: Transport
{ ListenerClosed { listener_id: ListenerId, reason: Result<(), <TTrans as Transport>::Error>, }, ListenerError { listener_id: ListenerId, error: <TTrans as Transport>::Error, }, NewListenerAddress { listener_id: ListenerId, listen_addr: Multiaddr, }, ExpiredListenerAddress { listener_id: ListenerId, listen_addr: Multiaddr, }, IncomingConnection(IncomingConnectionEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId>), IncomingConnectionError { local_addr: Multiaddr, send_back_addr: Multiaddr, error: IncomingError<<TTrans as Transport>::Error>, }, Connected { conn_info: TConnInfo, endpoint: ConnectedPoint, }, Replaced { new_info: TConnInfo, old_info: TConnInfo, closed_endpoint: ConnectedPoint, endpoint: ConnectedPoint, }, NodeClosed { conn_info: TConnInfo, endpoint: ConnectedPoint, error: HandledNodeError<THandlerErr>, }, DialError { new_state: PeerState, peer_id: TPeerId, multiaddr: Multiaddr, error: NetworkReachError<<TTrans as Transport>::Error, TConnInfo>, }, UnknownPeerDialError { multiaddr: Multiaddr, error: UnknownPeerDialErr<<TTrans as Transport>::Error>, handler: THandler, }, NodeEvent { conn_info: TConnInfo, event: TOutEvent, }, }

Event that can happen on the Network.

Variants

ListenerClosed

One of the listeners gracefully closed.

Fields of ListenerClosed

listener_id: ListenerId

The listener ID that closed.

reason: Result<(), <TTrans as Transport>::Error>

Reason for the closure. Contains Ok(()) if the stream produced None, or Err if the stream produced an error.

ListenerError

One of the listeners reported a non-fatal errored.

Fields of ListenerError

listener_id: ListenerId

The listener that errored.

error: <TTrans as Transport>::Error

The listener error.

NewListenerAddress

One of the listeners is now listening on an additional address.

Fields of NewListenerAddress

listener_id: ListenerId

The listener that is listening on the new address.

listen_addr: Multiaddr

The new address the listener is now also listening on.

ExpiredListenerAddress

One of the listeners is no longer listening on some address.

Fields of ExpiredListenerAddress

listener_id: ListenerId

The listener that is no longer listening on some address.

listen_addr: Multiaddr

The expired address.

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

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

local_addr: Multiaddr

Local connection address.

send_back_addr: Multiaddr

Address used to send back data to the remote.

error: IncomingError<<TTrans as Transport>::Error>

The error that happened.

Connected

A new connection to a peer has been opened.

Fields of Connected

conn_info: TConnInfo

Information about the connection, including the peer ID.

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

new_info: TConnInfo

Information about the new connection. The TPeerId is the same as the one as the one in old_info.

old_info: TConnInfo

Information about the old connection. The TPeerId is the same as the one as the one in new_info.

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

The handler of a node has produced an error.

Fields of NodeClosed

conn_info: TConnInfo

Information about the connection that has been closed.

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

new_state: PeerState

New state of a peer.

peer_id: TPeerId

Id of the peer we were trying to dial.

multiaddr: Multiaddr

The multiaddr we failed to reach.

error: NetworkReachError<<TTrans as Transport>::Error, TConnInfo>

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: UnknownPeerDialErr<<TTrans as Transport>::Error>

The error that happened.

handler: THandler

The handler that was passed to dial().

NodeEvent

A node produced a custom event.

Fields of NodeEvent

conn_info: TConnInfo

Connection that produced the event.

event: TOutEvent

Event that was produced by the node.

Trait Implementations

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

Auto Trait Implementations

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo = PeerId, TPeerId = PeerId> !RefUnwindSafe for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId>

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> Send for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TConnInfo: Send,
    THandler: Send,
    THandlerErr: Send,
    TInEvent: Send,
    TOutEvent: Send,
    TPeerId: Send,
    <TTrans as Transport>::Error: Send,
    <TTrans as Transport>::ListenerUpgrade: Send

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo = PeerId, TPeerId = PeerId> !Sync for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId>

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> Unpin for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId> where
    TConnInfo: Unpin,
    THandler: Unpin,
    THandlerErr: Unpin,
    TOutEvent: Unpin,
    TPeerId: Unpin,
    <TTrans as Transport>::Error: Unpin,
    <TTrans as Transport>::ListenerUpgrade: Unpin

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo = PeerId, TPeerId = PeerId> !UnwindSafe for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,