diff options
author | Neal H. Walfield <neal@pep.foundation> | 2018-07-29 15:52:24 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2018-07-29 15:52:24 +0200 |
commit | ea2d0d521c2094afb0abd49d2f0dbc3687306e22 (patch) | |
tree | 80ace54f4365ac6639084072bdf71320eb536ab6 /buffered-reader/src/dup.rs | |
parent | 94b8c8b4e7f5c26c06474614c276514e8f824723 (diff) |
buffered-reader: Provide a mechanism to rewind a BufferedReaderDup
- New method BufferedReaderDup::rewind.
Diffstat (limited to 'buffered-reader/src/dup.rs')
-rw-r--r-- | buffered-reader/src/dup.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/buffered-reader/src/dup.rs b/buffered-reader/src/dup.rs index c06721cc..ae9ce217 100644 --- a/buffered-reader/src/dup.rs +++ b/buffered-reader/src/dup.rs @@ -54,6 +54,11 @@ impl<'a, C> BufferedReaderDup<'a, C> { pub fn total_out(&self) -> usize { return self.cursor; } + + /// Resets the cursor to the beginning of the stream. + pub fn rewind(&mut self) { + self.cursor = 0; + } } impl<'a, C> io::Read for BufferedReaderDup<'a, C> { |