Struct libp2p::swarm::ConnectionClosed
source · pub struct ConnectionClosed<'a, Handler> {
pub peer_id: PeerId,
pub connection_id: ConnectionId,
pub endpoint: &'a ConnectedPoint,
pub handler: Handler,
pub remaining_established: usize,
}
Expand description
FromSwarm
variant that informs the behaviour about a closed connection to a peer.
This event is always paired with an earlier
FromSwarm::ConnectionEstablished
with the same peer ID, connection ID
and endpoint.
Fields§
§peer_id: PeerId
§connection_id: ConnectionId
§endpoint: &'a ConnectedPoint
§handler: Handler
§remaining_established: usize
Trait Implementations§
Auto Trait Implementations§
impl<'a, Handler> Freeze for ConnectionClosed<'a, Handler>where
Handler: Freeze,
impl<'a, Handler> RefUnwindSafe for ConnectionClosed<'a, Handler>where
Handler: RefUnwindSafe,
impl<'a, Handler> Send for ConnectionClosed<'a, Handler>where
Handler: Send,
impl<'a, Handler> Sync for ConnectionClosed<'a, Handler>where
Handler: Sync,
impl<'a, Handler> Unpin for ConnectionClosed<'a, Handler>where
Handler: Unpin,
impl<'a, Handler> UnwindSafe for ConnectionClosed<'a, Handler>where
Handler: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more