[−][src]Enum libp2prs_swarm::SwarmEvent
Event generated by the Swarm
.
Variants
A connection to the given peer has been opened.
Fields of ConnectionEstablished
stream_muxer: IStreamMuxer
The connection, AKA. the trait object of stream muxer.
direction: Direction
Direction of the connection.
tid: Option<usize>
The dial transaction id
A connection with the given peer has been closed.
Fields of ConnectionClosed
A stream failed to negotiate protocol with peer.
Fields of StreamError
A new substream opened.
Fields of StreamOpened
view: SubstreamView
The view of the opened substream.
An error happened on accepting incoming connection.
This can include, for example, an error during the handshake of the encryption layer, or the connection unexpectedly closed.
Fields of IncomingConnectionError
Fields of OutgoingConnectionError
peer_id: PeerId
The remote Peer Id.
error: SwarmError
The error that happened when dialing.
tid: usize
One of our listeners has a new address added.
One of our listeners has an address deleted.
One of the listeners gracefully closed.
Seems unlikely, as least in async-std
Fields of ListenerClosed
addresses: Vec<Multiaddr>
The addresses that the listener was listening on.
reason: TransportError
Reason for the closure. Contains Ok(())
if the stream produced None
, or Err
if the stream produced an error.
A Ping result generated by the Ping protocol handler.
Fields of PingResult
cid: ConnectionId
The connection Id.
result: Result<Duration, SwarmError>
The result. Duration means the TTL when succeeded, or SwarmError for failed.
An identify result generated by the Identify protocol handler.
Fields of IdentifyResult
cid: ConnectionId
The connection Id.
result: Result<(IdentifyInfo, Multiaddr), SwarmError>
The result. Duration means the TTL when succeeded, or SwarmError for failed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SwarmEvent
[src]
impl Send for SwarmEvent
[src]
impl !Sync for SwarmEvent
[src]
impl Unpin for SwarmEvent
[src]
impl !UnwindSafe for SwarmEvent
[src]
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> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[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]
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>,
V: MultiLane<T>,