pub struct CountingWriter<T> {
pub inner: T,
pub written: usize,
}Expand description
A wrapper that keeps track of the number of bytes written with the
underlying writer T.
Fields§
§inner: T§written: usizeImplementations§
Source§impl<T> CountingWriter<T>
impl<T> CountingWriter<T>
Trait Implementations§
Source§impl<T: Write> Write for CountingWriter<T>
impl<T: Write> Write for CountingWriter<T>
Source§impl<T: Write> Write for CountingWriter<T>
impl<T: Write> Write for CountingWriter<T>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this object, returning how many bytes were written. Read more
Source§fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
Attempts to write an entire buffer into this write. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Auto Trait Implementations§
impl<T> Freeze for CountingWriter<T>where
T: Freeze,
impl<T> RefUnwindSafe for CountingWriter<T>where
T: RefUnwindSafe,
impl<T> Send for CountingWriter<T>where
T: Send,
impl<T> Sync for CountingWriter<T>where
T: Sync,
impl<T> Unpin for CountingWriter<T>where
T: Unpin,
impl<T> UnsafeUnpin for CountingWriter<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CountingWriter<T>where
T: 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