pub struct Writer { /* private fields */ }Expand description
Sending half of a Duplex, sharing one deadline across writes and flushes.
Trait Implementations§
Source§impl Drop for Writer
impl Drop for Writer
Source§impl Write for Writer
impl Write for Writer
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Appends as many bytes as fit, waiting for space until the write deadline.
An expired deadline fails before accepting any bytes, even with space
free. An empty buf then returns zero, and a closed end fails with
io::ErrorKind::BrokenPipe.
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Checks the write deadline and that no output was lost, without waiting for the peer to read.
It fails with io::ErrorKind::BrokenPipe after local closure, or when
the reader closed with output unread.
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnsafeUnpin for Writer
impl UnwindSafe for Writer
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