Enum libp2p_swarm::SwarmEvent [−][src]
Event generated by the Swarm.
Variants
Event generated by the NetworkBehaviour.
A connection to the given peer has been opened.
Fields of ConnectionEstablished
peer_id: PeerIdIdentity of the peer that we have connected to.
endpoint: ConnectedPointEndpoint of the connection that has been opened.
num_established: NonZeroU32Number of established connections to this peer, including the one that has just been opened.
A connection with the given peer has been closed, possibly as a result of an error.
Fields of ConnectionClosed
peer_id: PeerIdIdentity of the peer that we have connected to.
endpoint: ConnectedPointEndpoint of the connection that has been closed.
num_established: u32Number of other remaining connections to this same peer.
cause: Option<ConnectionError<NodeHandlerWrapperError<THandleErr>>>Reason for the disconnection, if it was not a successful active close.
A new connection arrived on a listener and is in the process of protocol negotiation.
A corresponding ConnectionEstablished,
BannedPeer, or
IncomingConnectionError event will later be
generated for this connection.
Fields of IncomingConnection
local_addr: MultiaddrLocal connection address.
This address has been earlier reported with a NewListenAddr
event.
send_back_addr: MultiaddrAddress used to send back data to the remote.
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: MultiaddrLocal connection address.
This address has been earlier reported with a NewListenAddr
event.
send_back_addr: MultiaddrAddress used to send back data to the remote.
error: PendingConnectionError<Error>The error that happened.
We connected to a peer, but we immediately closed the connection because that peer is banned.
Fields of BannedPeer
peer_id: PeerIdIdentity of the banned peer.
endpoint: ConnectedPointEndpoint of the connection that has been closed.
Tried to dial an address but it ended up being unreachaable.
Fields of UnreachableAddr
peer_id: PeerIdPeerId that we were trying to reach.
address: MultiaddrAddress that we failed to reach.
error: PendingConnectionError<Error>Error that has been encountered.
attempts_remaining: u32Number of remaining connection attempts that are being tried for this peer.
Tried to dial an address but it ended up being unreachaable.
Contrary to UnreachableAddr, we don’t know the identity of the peer that we were trying
to reach.
Fields of UnknownPeerUnreachableAddr
address: MultiaddrAddress that we failed to reach.
error: PendingConnectionError<Error>Error that has been encountered.
NewListenAddr(Multiaddr)One of our listeners has reported a new local listening address.
ExpiredListenAddr(Multiaddr)One of our listeners has reported the expiration of a listening address.
One of the listeners gracefully closed.
Fields of ListenerClosed
addresses: Vec<Multiaddr>The addresses that the listener was listening on. These addresses are now considered
expired, similar to if a ExpiredListenAddr event
has been generated for each of them.
reason: Result<(), Error>Reason for the closure. Contains Ok(()) if the stream produced None, or Err
if the stream produced an error.
One of the listeners reported a non-fatal error.
Fields of ListenerError
error: ErrorThe listener error.
Dialing(PeerId)A new dialing attempt has been initiated.
A ConnectionEstablished
event is reported if the dialing attempt succeeds, otherwise a
UnreachableAddr event is reported
with attempts_remaining equal to 0.
Trait Implementations
impl<TBvEv: Debug, THandleErr: Debug> Debug for SwarmEvent<TBvEv, THandleErr>[src]
Auto Trait Implementations
impl<TBvEv, THandleErr> !RefUnwindSafe for SwarmEvent<TBvEv, THandleErr>
impl<TBvEv, THandleErr> Send for SwarmEvent<TBvEv, THandleErr> where
TBvEv: Send,
THandleErr: Send,
TBvEv: Send,
THandleErr: Send,
impl<TBvEv, THandleErr> Sync for SwarmEvent<TBvEv, THandleErr> where
TBvEv: Sync,
THandleErr: Sync,
TBvEv: Sync,
THandleErr: Sync,
impl<TBvEv, THandleErr> Unpin for SwarmEvent<TBvEv, THandleErr> where
TBvEv: Unpin,
THandleErr: Unpin,
TBvEv: Unpin,
THandleErr: Unpin,
impl<TBvEv, THandleErr> !UnwindSafe for SwarmEvent<TBvEv, THandleErr>
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,
pub 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[src]
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,