Struct libp2p_core::connection::Connection [−][src]
pub struct Connection<TMuxer, THandler> where
TMuxer: StreamMuxer,
THandler: ConnectionHandler<Substream = Substream<TMuxer>>, { /* fields omitted */ }
Expand description
A multiplexed connection to a peer with an associated ConnectionHandler
.
Implementations
impl<TMuxer, THandler> Connection<TMuxer, THandler> where
TMuxer: StreamMuxer,
THandler: ConnectionHandler<Substream = Substream<TMuxer>>,
impl<TMuxer, THandler> Connection<TMuxer, THandler> where
TMuxer: StreamMuxer,
THandler: ConnectionHandler<Substream = Substream<TMuxer>>,
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 the connection
handler and a Future
that resolves when connection shutdown is complete.