pub struct CountingWriter<W: Write> { /* private fields */ }Expand description
Position-tracking writer wrapper.
Wraps any std::io::Write implementor and tracks the byte offset written.
Implementations§
Source§impl<W: Write> CountingWriter<W>
impl<W: Write> CountingWriter<W>
Sourcepub fn with_offset(inner: W, offset: u64) -> Self
pub fn with_offset(inner: W, offset: u64) -> Self
Create a counting writer with an initial offset (e.g. for incremental appends).
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Consume the writer and return the inner writer.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for CountingWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for CountingWriter<W>where
W: RefUnwindSafe,
impl<W> Send for CountingWriter<W>where
W: Send,
impl<W> Sync for CountingWriter<W>where
W: Sync,
impl<W> Unpin for CountingWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for CountingWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for CountingWriter<W>where
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