Struct libp2p_yamux::Yamux
source · pub struct Yamux<C>(_);
Implementations
Trait Implementations
sourceimpl<C> StreamMuxer for Yamux<C>where
C: AsyncRead + AsyncWrite + 'static,
impl<C> StreamMuxer for Yamux<C>where
C: AsyncRead + AsyncWrite + 'static,
type Substream = StreamHandle<C>
type Substream = StreamHandle<C>
Type of the object that represents the raw substream where data can be read and written.
type OutboundSubstream = FutureResult<Option<<Yamux<C> as StreamMuxer>::Substream>, Error>
type OutboundSubstream = FutureResult<Option<<Yamux<C> as StreamMuxer>::Substream>, Error>
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, _: Self::OutboundSubstream)
fn destroy_outbound(&self, _: 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,
sub: &mut Self::Substream,
buf: &mut [u8]
) -> Poll<usize, IoError>
fn read_substream(
&self,
sub: &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,
sub: &mut Self::Substream,
buf: &[u8]
) -> Poll<usize, IoError>
fn write_substream(
&self,
sub: &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, sub: &mut Self::Substream) -> Poll<(), IoError>
fn flush_substream(&self, sub: &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, _: Self::Substream)
fn destroy_substream(&self, _: Self::Substream)
Destroys a substream.
Auto Trait Implementations
impl<C> !RefUnwindSafe for Yamux<C>
impl<C> Send for Yamux<C>where
C: Send,
impl<C> Sync for Yamux<C>where
C: Send,
impl<C> Unpin for Yamux<C>
impl<C> !UnwindSafe for Yamux<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