Struct libp2p_mplex::Multiplex
source · pub struct Multiplex<C> { /* private fields */ }
Expand description
Multiplexer. Implements the StreamMuxer
trait.
Trait Implementations
sourceimpl<C> StreamMuxer for Multiplex<C>where
C: AsyncRead + AsyncWrite,
impl<C> StreamMuxer for Multiplex<C>where
C: AsyncRead + AsyncWrite,
type Substream = Substream
type Substream = Substream
Type of the object that represents the raw substream where data can be read and written.
type OutboundSubstream = OutboundSubstream
type OutboundSubstream = OutboundSubstream
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,
substream: &mut Self::OutboundSubstream
) -> Poll<Option<Self::Substream>, IoError>
fn poll_outbound(
&self,
substream: &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,
substream: &mut Self::Substream,
buf: &mut [u8]
) -> Poll<usize, IoError>
fn read_substream(
&self,
substream: &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,
substream: &mut Self::Substream,
buf: &[u8]
) -> Poll<usize, IoError>
fn write_substream(
&self,
substream: &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, _substream: &mut Self::Substream) -> Poll<(), IoError>
fn flush_substream(&self, _substream: &mut Self::Substream) -> Poll<(), IoError>
Flushes a substream. The behaviour is the same as
tokio_io::AsyncWrite::poll_flush
. Read moresourcefn shutdown_substream(
&self,
sub: &mut Self::Substream,
_: Shutdown
) -> Poll<(), IoError>
fn shutdown_substream(
&self,
sub: &mut Self::Substream,
_: Shutdown
) -> Poll<(), IoError>
Attempts to shut down a substream. The behaviour is similar to
tokio_io::AsyncWrite::shutdown
. Read moresourcefn destroy_substream(&self, sub: Self::Substream)
fn destroy_substream(&self, sub: Self::Substream)
Destroys a substream.
Auto Trait Implementations
impl<C> !RefUnwindSafe for Multiplex<C>
impl<C> Send for Multiplex<C>where
C: Send,
impl<C> Sync for Multiplex<C>where
C: Send,
impl<C> Unpin for Multiplex<C>where
C: Unpin,
impl<C> !UnwindSafe for Multiplex<C>
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