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: 'static + StreamMuxer + Send + Sync,
<T as StreamMuxer>::OutboundSubstream: Send,
<T as StreamMuxer>::Substream: 'static + Send + Unpin,
<T as StreamMuxer>::Error: 'static + Send + Sync,
pub fn new<T>(muxer: T) -> StreamMuxerBoxwhere
T: 'static + StreamMuxer + Send + Sync,
<T as StreamMuxer>::OutboundSubstream: Send,
<T as StreamMuxer>::Substream: 'static + Send + Unpin,
<T as StreamMuxer>::Error: 'static + Send + Sync,
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<<StreamMuxerBox as StreamMuxer>::Substream>, <StreamMuxerBox as StreamMuxer>::Error>>
fn poll_event(
&self,
cx: &mut Context<'_>
) -> Poll<Result<StreamMuxerEvent<<StreamMuxerBox as StreamMuxer>::Substream>, <StreamMuxerBox as StreamMuxer>::Error>>
Polls for a connection-wide event. Read more
source§fn open_outbound(&self) -> <StreamMuxerBox as StreamMuxer>::OutboundSubstream
fn open_outbound(&self) -> <StreamMuxerBox as StreamMuxer>::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 <StreamMuxerBox as StreamMuxer>::OutboundSubstream
) -> Poll<Result<<StreamMuxerBox as StreamMuxer>::Substream, <StreamMuxerBox as StreamMuxer>::Error>>
fn poll_outbound(
&self,
cx: &mut Context<'_>,
s: &mut <StreamMuxerBox as StreamMuxer>::OutboundSubstream
) -> Poll<Result<<StreamMuxerBox as StreamMuxer>::Substream, <StreamMuxerBox as StreamMuxer>::Error>>
Polls the outbound substream. Read more
source§fn destroy_outbound(
&self,
substream: <StreamMuxerBox as StreamMuxer>::OutboundSubstream
)
fn destroy_outbound(
&self,
substream: <StreamMuxerBox as StreamMuxer>::OutboundSubstream
)
Destroys an outbound substream future. Use this after the outbound substream has finished,
or if you want to interrupt it. Read more
source§fn poll_close(
&self,
cx: &mut Context<'_>
) -> Poll<Result<(), <StreamMuxerBox as StreamMuxer>::Error>>
fn poll_close(
&self,
cx: &mut Context<'_>
) -> Poll<Result<(), <StreamMuxerBox as StreamMuxer>::Error>>
Closes this
StreamMuxer
. Read more