pub struct WriteHalf<T> { /* private fields */ }
Available on crate feature
io
only.Expand description
The writable half of an object returned from AsyncRead::split
.
Implementations§
source§impl<T> WriteHalf<T>
impl<T> WriteHalf<T>
sourcepub fn is_pair_of(&self, other: &ReadHalf<T>) -> bool
pub fn is_pair_of(&self, other: &ReadHalf<T>) -> bool
Checks if this WriteHalf
and some ReadHalf
were split from the same stream.
source§impl<T: Unpin> WriteHalf<T>
impl<T: Unpin> WriteHalf<T>
sourcepub fn reunite(self, other: ReadHalf<T>) -> Result<T, ReuniteError<T>>
pub fn reunite(self, other: ReadHalf<T>) -> Result<T, ReuniteError<T>>
Attempts to put the two “halves” of a split AsyncRead + AsyncWrite
back
together. Succeeds only if the ReadHalf<T>
and WriteHalf<T>
are
a matching pair originating from the same call to AsyncReadExt::split
.
Trait Implementations§
source§impl<W: AsyncWrite> AsyncWrite for WriteHalf<W>
impl<W: AsyncWrite> AsyncWrite for WriteHalf<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<T> Freeze for WriteHalf<T>
impl<T> !RefUnwindSafe for WriteHalf<T>
impl<T> Send for WriteHalf<T>where
T: Send,
impl<T> Sync for WriteHalf<T>where
T: Send,
impl<T> Unpin for WriteHalf<T>
impl<T> !UnwindSafe for WriteHalf<T>
Blanket Implementations§
source§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
source§fn flush(&mut self) -> Flush<'_, Self> ⓘwhere
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self> ⓘwhere
Self: Unpin,
Available on crate feature
io
only.Creates a future which will entirely flush this
AsyncWrite
. Read moresource§fn close(&mut self) -> Close<'_, Self> ⓘwhere
Self: Unpin,
fn close(&mut self) -> Close<'_, Self> ⓘwhere
Self: Unpin,
Available on crate feature
io
only.Creates a future which will entirely close this
AsyncWrite
.source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> ⓘwhere
Self: Unpin,
fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> ⓘwhere
Self: Unpin,
Available on crate feature
io
only.Creates a future which will write bytes from
buf
into the object. Read moresource§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectored<'a, Self> ⓘwhere
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectored<'a, Self> ⓘwhere
Self: Unpin,
Available on crate feature
io
only.Creates a future which will write bytes from
bufs
into the object using vectored
IO operations. Read moresource§fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> ⓘwhere
Self: Unpin,
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> ⓘwhere
Self: Unpin,
Available on crate feature
io
only.Write data into this object. Read more
source§fn write_all_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSlice<'a>],
) -> WriteAllVectored<'a, Self> ⓘwhere
Self: Unpin,
fn write_all_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSlice<'a>],
) -> WriteAllVectored<'a, Self> ⓘwhere
Self: Unpin,
Available on crate feature
io
only.Attempts to write multiple buffers into this writer. Read more
source§fn compat_write(self) -> Compat<Self> ⓘ
fn compat_write(self) -> Compat<Self> ⓘ
Available on crate features
io
and io-compat
only.Wraps an
AsyncWrite
in a compatibility wrapper that allows it to be
used as a futures 0.1 / tokio-io 0.1 AsyncWrite
.
Requires the io-compat
feature to enable.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