Struct libp2p::core::connection::Connection [−][src]
pub struct Connection<TMuxer, THandler> where
THandler: ConnectionHandler<Substream = SubstreamRef<Arc<TMuxer>>>,
TMuxer: StreamMuxer, { /* fields omitted */ }Expand description
A multiplexed connection to a peer with an associated ConnectionHandler.
Implementations
impl<TMuxer, THandler> Connection<TMuxer, THandler> where
THandler: ConnectionHandler<Substream = SubstreamRef<Arc<TMuxer>>>,
TMuxer: StreamMuxer, [src]
impl<TMuxer, THandler> Connection<TMuxer, THandler> where
THandler: ConnectionHandler<Substream = SubstreamRef<Arc<TMuxer>>>,
TMuxer: StreamMuxer, [src]Builds a new Connection from the given substream multiplexer
and connection handler.
Returns a mutable reference to the ConnectionHandler
Notifies the connection handler of an event.
Begins an orderly shutdown of the connection, returning a
Future that resolves when connection shutdown is complete.
pub fn poll(
self: Pin<&mut Connection<TMuxer, THandler>>,
cx: &mut Context<'_>
) -> Poll<Result<Event<<THandler as ConnectionHandler>::OutEvent>, ConnectionError<<THandler as ConnectionHandler>::Error>>>[src]
pub fn poll(
self: Pin<&mut Connection<TMuxer, THandler>>,
cx: &mut Context<'_>
) -> Poll<Result<Event<<THandler as ConnectionHandler>::OutEvent>, ConnectionError<<THandler as ConnectionHandler>::Error>>>[src]Polls the connection for events produced by the associated handler as a result of I/O activity on the substream multiplexer.
Trait Implementations
impl<TMuxer, THandler> Debug for Connection<TMuxer, THandler> where
THandler: ConnectionHandler<Substream = SubstreamRef<Arc<TMuxer>>> + Debug,
TMuxer: StreamMuxer, [src]
impl<TMuxer, THandler> Debug for Connection<TMuxer, THandler> where
THandler: ConnectionHandler<Substream = SubstreamRef<Arc<TMuxer>>> + Debug,
TMuxer: StreamMuxer, [src]impl<TMuxer, THandler> Unpin for Connection<TMuxer, THandler> where
THandler: ConnectionHandler<Substream = SubstreamRef<Arc<TMuxer>>>,
TMuxer: StreamMuxer, [src]Auto Trait Implementations
impl<TMuxer, THandler> RefUnwindSafe for Connection<TMuxer, THandler> where
THandler: RefUnwindSafe,
TMuxer: RefUnwindSafe,
<THandler as ConnectionHandler>::OutboundOpenInfo: RefUnwindSafe,
<TMuxer as StreamMuxer>::OutboundSubstream: RefUnwindSafe, impl<TMuxer, THandler> Send for Connection<TMuxer, THandler> where
THandler: Send,
TMuxer: Send + Sync,
<THandler as ConnectionHandler>::OutboundOpenInfo: Send,
<TMuxer as StreamMuxer>::OutboundSubstream: Send, impl<TMuxer, THandler> Sync for Connection<TMuxer, THandler> where
THandler: Sync,
TMuxer: Send + Sync,
<THandler as ConnectionHandler>::OutboundOpenInfo: Sync,
<TMuxer as StreamMuxer>::OutboundSubstream: Sync, impl<TMuxer, THandler> UnwindSafe for Connection<TMuxer, THandler> where
THandler: UnwindSafe,
TMuxer: RefUnwindSafe,
<THandler as ConnectionHandler>::OutboundOpenInfo: RefUnwindSafe + UnwindSafe,
<TMuxer as StreamMuxer>::OutboundSubstream: RefUnwindSafe + UnwindSafe,