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) -> StreamMuxerBoxwhere
T: StreamMuxer + Send + Sync + 'static,
T::OutboundSubstream: Send,
T::Substream: Send,
pub fn new<T>(muxer: T) -> StreamMuxerBoxwhere
T: StreamMuxer + Send + Sync + 'static,
T::OutboundSubstream: Send,
T::Substream: Send,
Turns a stream muxer into a StreamMuxerBox.
Trait Implementations
sourceimpl StreamMuxer for StreamMuxerBox
impl StreamMuxer for StreamMuxerBox
type Substream = usize
type Substream = usize
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_inbound(&self) -> Poll<Option<Self::Substream>, IoError>
fn poll_inbound(&self) -> Poll<Option<Self::Substream>, IoError>
Polls for an inbound substream. Read more
sourcefn open_outbound(&self) -> Self::OutboundSubstream
fn open_outbound(&self) -> Self::OutboundSubstream
Opens a new outgoing substream, and produces a future that will be resolved when it becomes
available. Read more
sourcefn poll_outbound(
&self,
s: &mut Self::OutboundSubstream
) -> Poll<Option<Self::Substream>, IoError>
fn poll_outbound(
&self,
s: &mut Self::OutboundSubstream
) -> Poll<Option<Self::Substream>, IoError>
Polls the outbound substream. Read more
sourcefn destroy_outbound(&self, substream: Self::OutboundSubstream)
fn destroy_outbound(&self, substream: Self::OutboundSubstream)
Destroys an outbound substream. Use this after the outbound substream has finished, or if
you want to interrupt it. Read more
sourcefn read_substream(
&self,
s: &mut Self::Substream,
buf: &mut [u8]
) -> Poll<usize, IoError>
fn read_substream(
&self,
s: &mut Self::Substream,
buf: &mut [u8]
) -> Poll<usize, IoError>
Reads data from a substream. The behaviour is the same as
tokio_io::AsyncRead::poll_read. Read moresourcefn write_substream(
&self,
s: &mut Self::Substream,
buf: &[u8]
) -> Poll<usize, IoError>
fn write_substream(
&self,
s: &mut Self::Substream,
buf: &[u8]
) -> Poll<usize, IoError>
Write data to a substream. The behaviour is the same as
tokio_io::AsyncWrite::poll_write. Read moresourcefn flush_substream(&self, s: &mut Self::Substream) -> Poll<(), IoError>
fn flush_substream(&self, s: &mut Self::Substream) -> Poll<(), IoError>
Flushes a substream. The behaviour is the same as
tokio_io::AsyncWrite::poll_flush. Read moresourcefn shutdown_substream(
&self,
s: &mut Self::Substream,
kind: Shutdown
) -> Poll<(), IoError>
fn shutdown_substream(
&self,
s: &mut Self::Substream,
kind: Shutdown
) -> Poll<(), IoError>
Attempts to shut down a substream. The behaviour is similar to
tokio_io::AsyncWrite::shutdown. Read moresourcefn destroy_substream(&self, s: Self::Substream)
fn destroy_substream(&self, s: Self::Substream)
Destroys a substream.
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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