pub struct MergeIO<R, W>{ /* private fields */ }
Expand description
Merged I/O, delegates reads and writes to the provided
AsyncRead
(R
) and
AsyncWrite
(W
).
Implementations§
Source§impl<R, W> MergeIO<R, W>
impl<R, W> MergeIO<R, W>
Sourcepub fn new(reader: R, writer: W) -> Self
pub fn new(reader: R, writer: W) -> Self
Creates new MergeIO
, that reads to reader
and
writes to writer
.
Sourcepub fn reader_mut(&mut self) -> &mut R
pub fn reader_mut(&mut self) -> &mut R
Provides mut
access to reader
.
Sourcepub fn writer_mut(&mut self) -> &mut W
pub fn writer_mut(&mut self) -> &mut W
Provides mut
access to writer
.
Sourcepub fn into_inner(self) -> (R, W)
pub fn into_inner(self) -> (R, W)
Deconstructs MergeIO
into the reader
and writer
.
Trait Implementations§
Source§impl<R, W> AsyncRead for MergeIO<R, W>
impl<R, W> AsyncRead for MergeIO<R, W>
Source§impl<R, W> AsyncWrite for MergeIO<R, W>
impl<R, W> AsyncWrite for MergeIO<R, W>
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Attempt to write bytes from
buf
into the object. Read moreSource§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize>>
Attempt to write bytes from
bufs
into the object using vectored
IO operations. Read moreAuto Trait Implementations§
impl<R, W> Freeze for MergeIO<R, W>
impl<R, W> RefUnwindSafe for MergeIO<R, W>where
R: RefUnwindSafe,
W: RefUnwindSafe,
impl<R, W> Send for MergeIO<R, W>
impl<R, W> Sync for MergeIO<R, W>
impl<R, W> Unpin for MergeIO<R, W>
impl<R, W> UnwindSafe for MergeIO<R, W>where
R: UnwindSafe,
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more