Struct buffered_reader::Adapter[][src]

pub struct Adapter<T: BufferedReader<B>, B: Debug + Send + Sync, C: Debug + Sync + Send> { /* fields omitted */ }

Changes the cookie type without introducing any buffering.

If you have a b: BufferedReader<B> but need a c: BufferedReader<C>, then one way to do that is to use let c = Generic::with_cookie(b, _), but that introduces buffering. This Adapter also changes cookie types, but does no buffering of its own.

Implementations

impl<T: BufferedReader<B>, B: Debug + Sync + Send> Adapter<T, B, ()>[src]

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

Instantiates a new adapter.

reader is the source to wrap.

impl<T: BufferedReader<B>, B: Debug + Send + Sync, C: Debug + Sync + Send> Adapter<T, B, 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<B>, B: Debug + Send + Sync, C: Debug + Sync + Send> BufferedReader<C> for Adapter<T, B, C>[src]

impl<T: Debug + BufferedReader<B>, B: Debug + Send + Sync, C: Debug + Sync + Send> Debug for Adapter<T, B, C>[src]

impl<T: BufferedReader<B>, B: Debug + Send + Sync, C: Debug + Sync + Send> Display for Adapter<T, B, C>[src]

impl<T: BufferedReader<B>, B: Debug + Send + Sync, C: Debug + Sync + Send> Read for Adapter<T, B, C>[src]

Auto Trait Implementations

impl<T, B, C> RefUnwindSafe for Adapter<T, B, C> where
    B: RefUnwindSafe,
    C: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, B, C> Send for Adapter<T, B, C>

impl<T, B, C> Sync for Adapter<T, B, C>

impl<T, B, C> Unpin for Adapter<T, B, C> where
    B: Unpin,
    C: Unpin,
    T: Unpin

impl<T, B, C> UnwindSafe for Adapter<T, B, C> where
    B: UnwindSafe,
    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.