[][src]Struct buf_redux::Unbuffer

pub struct Unbuffer<R> { /* fields omitted */ }
[]

A Read adapter for a consumed BufReader which will empty bytes from the buffer before reading from R directly. Frees the buffer when it has been emptied.

Methods

impl<R> Unbuffer<R>[src][]

pub fn is_buf_empty(&self) -> bool[src][]

Returns true if the buffer still has some bytes left, false otherwise.

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

Returns the number of bytes remaining in the buffer.

pub fn buf(&self) -> &[u8][src][]

Get a slice over the available bytes in the buffer.

pub fn into_inner(self) -> R[src][]

Return the underlying reader, releasing the buffer.

Trait Implementations

impl<R: Debug> Debug for Unbuffer<R>[src][+]

impl<R: Read> Read for Unbuffer<R>[src][+]

Auto Trait Implementations

impl<R> RefUnwindSafe for Unbuffer<R> where
    R: RefUnwindSafe

impl<R> Send for Unbuffer<R> where
    R: Send

impl<R> Sync for Unbuffer<R> where
    R: Sync

impl<R> Unpin for Unbuffer<R> where
    R: Unpin

impl<R> UnwindSafe for Unbuffer<R> where
    R: 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, 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.