[−][src]Enum libp2p_core::network::NetworkEvent
Event that can happen on the Network
.
Variants
One of the listeners gracefully closed.
Fields of ListenerClosed
One of the listeners reported a non-fatal error.
Fields of ListenerError
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.
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.
A new connection arrived on a listener.
To accept the connection, see Network::accept
.
Fields of IncomingConnection
listener_id: ListenerId
The listener who received the connection.
connection: IncomingConnection<TTrans::ListenerUpgrade>
The pending incoming connection.
An error happened on a connection during its initial handshake.
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: PendingConnectionError<TTrans::Error>
The error that happened.
A new connection to a peer has been established.
Fields of ConnectionEstablished
connection: EstablishedConnection<'a, TInEvent, TConnInfo>
The newly established connection.
num_established: NonZeroU32
The total number of established connections to the same peer, including the one that has just been opened.
An established connection to a peer has been closed.
A connection may close if
- it encounters an error, which includes the connection being
closed by the remote. In this case
error
isSome
. - it was actively closed by
EstablishedConnection::start_close
, i.e. a successful, orderly close. In this caseerror
isNone
. - it was actively closed by
super::peer::ConnectedPeer::disconnect
orsuper::peer::DialingPeer::disconnect
, i.e. dropped without an orderly close. In this caseerror
isNone
.
Fields of ConnectionClosed
id: ConnectionId
The ID of the connection that encountered an error.
connected: Connected<TConnInfo>
Information about the connection that encountered the error.
error: Option<ConnectionError<<THandler::Handler as ConnectionHandler>::Error>>
The error that occurred.
num_established: u32
The remaining number of established connections to the same peer.
A dialing attempt to an address of a peer failed.
Fields of DialError
attempts_remaining: u32
The number of remaining dialing attempts.
peer_id: TPeerId
Id of the peer we were trying to dial.
multiaddr: Multiaddr
The multiaddr we failed to reach.
error: PendingConnectionError<TTrans::Error>
The error that happened.
Failed to reach a peer that we were trying to dial.
Fields of UnknownPeerDialError
multiaddr: Multiaddr
The multiaddr we failed to reach.
error: PendingConnectionError<TTrans::Error>
The error that happened.
An established connection produced an event.
Fields of ConnectionEvent
connection: EstablishedConnection<'a, TInEvent, TConnInfo>
The connection on which the event occurred.
event: TOutEvent
Event that was produced by the node.
An established connection has changed its address.
Fields of AddressChange
connection: EstablishedConnection<'a, TInEvent, TConnInfo>
The connection whose address has changed.
new_endpoint: ConnectedPoint
New endpoint of this connection.
old_endpoint: ConnectedPoint
Old endpoint of this connection.
Trait Implementations
impl<TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId, '_> Debug for NetworkEvent<'_, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> where
TInEvent: Debug,
TOutEvent: Debug,
TTrans: Transport,
TTrans::Error: Debug,
THandler: IntoConnectionHandler<TConnInfo>,
<THandler::Handler as ConnectionHandler>::Error: Debug,
TConnInfo: Debug,
TPeerId: Debug,
[src]
TInEvent: Debug,
TOutEvent: Debug,
TTrans: Transport,
TTrans::Error: Debug,
THandler: IntoConnectionHandler<TConnInfo>,
<THandler::Handler as ConnectionHandler>::Error: Debug,
TConnInfo: Debug,
TPeerId: Debug,
Auto Trait Implementations
impl<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> !RefUnwindSafe for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId>
impl<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> Send for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> where
TConnInfo: Send,
TInEvent: Send,
TOutEvent: Send,
TPeerId: Send,
<TTrans as Transport>::Error: Send,
<<THandler as IntoConnectionHandler<TConnInfo>>::Handler as ConnectionHandler>::Error: Send,
<THandler as IntoConnectionHandler<TConnInfo>>::Handler: ConnectionHandler,
<TTrans as Transport>::ListenerUpgrade: Send,
TConnInfo: Send,
TInEvent: Send,
TOutEvent: Send,
TPeerId: Send,
<TTrans as Transport>::Error: Send,
<<THandler as IntoConnectionHandler<TConnInfo>>::Handler as ConnectionHandler>::Error: Send,
<THandler as IntoConnectionHandler<TConnInfo>>::Handler: ConnectionHandler,
<TTrans as Transport>::ListenerUpgrade: Send,
impl<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> Sync for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> where
TConnInfo: Sync,
TInEvent: Send,
TOutEvent: Sync,
TPeerId: Sync,
<TTrans as Transport>::Error: Sync,
<<THandler as IntoConnectionHandler<TConnInfo>>::Handler as ConnectionHandler>::Error: Sync,
<THandler as IntoConnectionHandler<TConnInfo>>::Handler: ConnectionHandler,
<TTrans as Transport>::ListenerUpgrade: Sync,
TConnInfo: Sync,
TInEvent: Send,
TOutEvent: Sync,
TPeerId: Sync,
<TTrans as Transport>::Error: Sync,
<<THandler as IntoConnectionHandler<TConnInfo>>::Handler as ConnectionHandler>::Error: Sync,
<THandler as IntoConnectionHandler<TConnInfo>>::Handler: ConnectionHandler,
<TTrans as Transport>::ListenerUpgrade: Sync,
impl<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> Unpin for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> where
TConnInfo: Unpin,
TOutEvent: Unpin,
TPeerId: Unpin,
<TTrans as Transport>::Error: Unpin,
<<THandler as IntoConnectionHandler<TConnInfo>>::Handler as ConnectionHandler>::Error: Unpin,
<THandler as IntoConnectionHandler<TConnInfo>>::Handler: ConnectionHandler,
<TTrans as Transport>::ListenerUpgrade: Unpin,
TConnInfo: Unpin,
TOutEvent: Unpin,
TPeerId: Unpin,
<TTrans as Transport>::Error: Unpin,
<<THandler as IntoConnectionHandler<TConnInfo>>::Handler as ConnectionHandler>::Error: Unpin,
<THandler as IntoConnectionHandler<TConnInfo>>::Handler: ConnectionHandler,
<TTrans as Transport>::ListenerUpgrade: Unpin,
impl<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> !UnwindSafe for NetworkEvent<'a, TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,