Struct buffered_reader::Generic[][src]

pub struct Generic<T: Read + Send + Sync, C: Debug + Sync + Send> { /* fields omitted */ }

Wraps a Reader.

This is useful when reading from a generic std::io::Reader. To read from a file, use File. To read from a buffer, use Memory. Both are more efficient than Generic.

Implementations

impl<T: Read + Send + Sync> Generic<T, ()>[src]

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

Instantiate a new generic reader. reader is the source to wrap. preferred_chuck_size is the preferred chuck size. If None, then the default will be used, which is usually what you want.

impl<T: Read + Send + Sync, C: Debug + Sync + Send> Generic<T, C>[src]

Like new(), but sets a cookie, which can be retrieved using the cookie_ref and cookie_mut methods, and set using the cookie_set method.

pub fn reader_ref(&self) -> &T[src]

Returns a reference to the wrapped writer.

pub fn reader_mut(&mut self) -> &mut T[src]

Returns a mutable reference to the wrapped writer.

pub fn into_reader(self) -> T[src]

Returns the wrapped writer.

Trait Implementations

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

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

impl<T: Read + Send + Sync, C: Debug + Sync + Send> Display for Generic<T, C>[src]

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

Auto Trait Implementations

impl<T, C> !RefUnwindSafe for Generic<T, C>

impl<T, C> Send for Generic<T, C>

impl<T, C> Sync for Generic<T, C>

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

impl<T, C> !UnwindSafe for Generic<T, C>

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.