[][src]Struct buffered_reader::Reserve

pub struct Reserve<T: BufferedReader<C>, C> { /* fields omitted */ }

A Reserve allows a reader to read everything except for the last N bytes (the reserve) from the underlying BufferedReader.

Note: because the Reserve doesn't generally know how much data can be read from the underlying BufferedReader, it causes at least N bytes to by buffered.

Implementations

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

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

Instantiates a new Reserve.

reader is the source to wrap. reserve is the number of bytes that will not be returned to the reader.

impl<T: BufferedReader<C>, C> Reserve<T, C>[src]

Like new(), but sets a cookie.

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

Trait Implementations

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

fn data(&mut self, amount: usize) -> Result<&[u8], Error>[src]

Return the buffer. Ensure that it contains at least amount bytes.

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

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

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

Auto Trait Implementations

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

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

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

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

impl<T, C> UnwindSafe for Reserve<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.