[][src]Struct buffered_reader::Dup

pub struct Dup<T: BufferedReader<C>, 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.

Implementations

impl<T: BufferedReader<()>> Dup<T, ()>[src]

pub fn new(reader: T) -> Self[src]

Instantiates a new Dup buffered reader.

reader is the BufferedReader to duplicate.

impl<T: BufferedReader<C>, C> Dup<T, 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<T: BufferedReader<C>, C> BufferedReader<C> for Dup<T, C>[src]

impl<T: BufferedReader<C>, C> Debug for Dup<T, C>[src]

impl<T: BufferedReader<C>, C> Display for Dup<T, C>[src]

impl<T: BufferedReader<C>, C> Read for Dup<T, C>[src]

Auto Trait Implementations

impl<T, C> RefUnwindSafe for Dup<T, C> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, C> Send for Dup<T, C> where
    C: Send,
    T: Send

impl<T, C> Sync for Dup<T, C> where
    C: Sync,
    T: Sync

impl<T, C> Unpin for Dup<T, C> where
    C: Unpin,
    T: Unpin

impl<T, C> UnwindSafe for Dup<T, C> where
    C: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.