Struct libp2p_core::muxing::StreamMuxerBox
source · [−]pub struct StreamMuxerBox { /* private fields */ }Expand description
Abstract StreamMuxer.
Implementations
sourceimpl StreamMuxerBox
impl StreamMuxerBox
sourcepub fn new<T>(muxer: T) -> StreamMuxerBox where
T: StreamMuxer + Send + Sync + 'static,
T::OutboundSubstream: Send,
T::Substream: Send + Unpin + 'static,
T::Error: Send + Sync + 'static,
pub fn new<T>(muxer: T) -> StreamMuxerBox where
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
sourceimpl 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.
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
Auto Trait Implementations
impl !RefUnwindSafe for StreamMuxerBox
impl Send for StreamMuxerBox
impl Sync for StreamMuxerBox
impl Unpin for StreamMuxerBox
impl !UnwindSafe for StreamMuxerBox
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more