[][src]Struct buffered_reader::Dup

pub struct Dup<'a, C> { /* fields omitted */ }

Duplicates the underlying BufferedReader without consuming any of the data.

Note: this will likely cause the underlying stream to buffer as much data as you read. Thus, it should only be used for peeking at the underlying BufferedReader.

Methods

impl<'a> Dup<'a, ()>[src]

pub fn new(reader: Box<dyn BufferedReader<()> + 'a>) -> Self[src]

Instantiates a new Dup buffered reader.

reader is the BufferedReader to duplicate.

impl<'a, C> Dup<'a, C>[src]

Like new(), but uses a cookie.

The cookie can be retrieved using the cookie_ref and cookie_mut methods, and set using the cookie_set method.

pub fn total_out(&self) -> usize[src]

Returns the number of bytes that this reader has consumed.

pub fn rewind(&mut self)[src]

Resets the cursor to the beginning of the stream.

Trait Implementations

impl<'a, C> BufferedReader<C> for Dup<'a, C>[src]

impl<'a, C> Display for Dup<'a, C>[src]

impl<'a, C> Debug for Dup<'a, C>[src]

impl<'a, C> Read for Dup<'a, C>[src]

Auto Trait Implementations

impl<'a, C> !Send for Dup<'a, C>

impl<'a, C> !Sync for Dup<'a, C>

impl<'a, C> Unpin for Dup<'a, C> where
    C: Unpin

impl<'a, C> !UnwindSafe for Dup<'a, C>

impl<'a, C> !RefUnwindSafe for Dup<'a, C>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]