[][src]Enum susyp2p::core::nodes::raw_swarm::RawSwarmEvent

pub enum RawSwarmEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo = PeerId, TPeerId = PeerId> where
    TConnInfo: 'a,
    THandler: 'a,
    THandlerErr: 'a,
    TInEvent: 'a,
    TOutEvent: 'a,
    TPeerId: 'a,
    TTrans: Transport,
    <TTrans as Transport>::Error: 'a, 
{ ListenerClosed { listener: <TTrans as Transport>::Listener, result: Result<(), <<TTrans as Transport>::Listener as Stream>::Error>, }, NewListenerAddress { listen_addr: Multiaddr, }, ExpiredListenerAddress { listen_addr: Multiaddr, }, IncomingConnection(IncomingConnectionEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, TPeerId>), IncomingConnectionError { listen_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: RawSwarmReachError<<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 RawSwarm.

Variants

ListenerClosed

One of the listeners gracefully closed.

Fields of ListenerClosed

listener: <TTrans as Transport>::Listener

The listener which closed.

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

The error that happened. Ok if gracefully closed.

NewListenerAddress

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

Fields of NewListenerAddress

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

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

listen_addr: Multiaddr

The address of the listener which received the connection.

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: RawSwarmReachError<<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 RawSwarmEvent<'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, TPeerId> Send for RawSwarmEvent<'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>::Listener: Send,
    <TTrans as Transport>::ListenerUpgrade: Send

impl<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo = PeerId, TPeerId = PeerId> !Sync for RawSwarmEvent<'a, TTrans, TInEvent, TOutEvent, THandler, THandlerErr, TConnInfo, 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 = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto 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<T> Borrow for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.