pub struct IoWriter<W: Write> { /* private fields */ }Expand description
Buffered adapter that lets any std::io::Write act as a Writer.
Errors are sticky: the first failure stops all further output and is
returned by IoWriter::finish. Buffered bytes are only written by
IoWriter::finish or IoWriter::into_result; dropping the adapter
discards them.
Implementations§
Trait Implementations§
Source§impl<W: Write> Writer for IoWriter<W>
impl<W: Write> Writer for IoWriter<W>
fn write(&mut self, bytes: &[u8])
fn write_byte(&mut self, byte: u8)
Source§fn write_with(&mut self, len: usize, fill: impl FnOnce(&mut [u8]) -> usize)
fn write_with(&mut self, len: usize, fill: impl FnOnce(&mut [u8]) -> usize)
Hands the sink a scratch region of
len bytes, keeps the first
fill(region) bytes of it and discards the rest.fn reserve(&mut self, _additional: usize)
Auto Trait Implementations§
impl<W> !RefUnwindSafe for IoWriter<W>
impl<W> !UnwindSafe for IoWriter<W>
impl<W> Freeze for IoWriter<W>where
W: Freeze,
impl<W> Send for IoWriter<W>where
W: Send,
impl<W> Sync for IoWriter<W>where
W: Sync,
impl<W> Unpin for IoWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for IoWriter<W>where
W: UnsafeUnpin,
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