Struct libp2p_core::muxing::StreamMuxerBox
source · pub struct StreamMuxerBox { /* private fields */ }
Expand description
Abstract StreamMuxer
.
Implementations§
source§impl StreamMuxerBox
impl StreamMuxerBox
sourcepub fn new<T>(muxer: T) -> StreamMuxerBoxwhere
T: StreamMuxer + Send + Sync + 'static,
T::OutboundSubstream: Send,
T::Substream: Send + Unpin + 'static,
T::Error: Send + Sync + 'static,
pub fn new<T>(muxer: T) -> StreamMuxerBoxwhere
T: StreamMuxer + Send + Sync + 'static,
T::OutboundSubstream: Send,
T::Substream: Send + Unpin + 'static,
T::Error: Send + Sync + 'static,
Turns a stream muxer into a StreamMuxerBox
.
Trait Implementations§
source§impl StreamMuxer for StreamMuxerBox
impl StreamMuxer for StreamMuxerBox
§type Substream = SubstreamBox
type Substream = SubstreamBox
Type of the object that represents the raw substream where data can be read and written.
§type OutboundSubstream = usize
type OutboundSubstream = usize
Future that will be resolved when the outgoing substream is open.
source§fn poll_event(
&self,
cx: &mut Context<'_>
) -> Poll<Result<StreamMuxerEvent<Self::Substream>, Self::Error>>
fn poll_event(
&self,
cx: &mut Context<'_>
) -> Poll<Result<StreamMuxerEvent<Self::Substream>, Self::Error>>
Polls for a connection-wide event. Read more
source§fn open_outbound(&self) -> Self::OutboundSubstream
fn open_outbound(&self) -> Self::OutboundSubstream
Opens a new outgoing substream, and produces the equivalent to a future that will be
resolved when it becomes available. Read more
source§fn poll_outbound(
&self,
cx: &mut Context<'_>,
s: &mut Self::OutboundSubstream
) -> Poll<Result<Self::Substream, Self::Error>>
fn poll_outbound(
&self,
cx: &mut Context<'_>,
s: &mut Self::OutboundSubstream
) -> Poll<Result<Self::Substream, Self::Error>>
Polls the outbound substream. Read more
source§fn destroy_outbound(&self, substream: Self::OutboundSubstream)
fn destroy_outbound(&self, substream: Self::OutboundSubstream)
Destroys an outbound substream future. Use this after the outbound substream has finished,
or if you want to interrupt it. Read more