[][src]Struct neli::StreamReadBuffer

pub struct StreamReadBuffer<T> { /* fields omitted */ }

A stream reader that will allow piece-by-piece reading of a buffer

Methods

impl<T> StreamReadBuffer<T> where
    T: AsRef<[u8]>, 
[src]

Important traits for StreamReadBuffer<T>
pub fn new(buf: T) -> StreamReadBuffer<T>[src]

Create a new reader with an underlying data type that can be expresssed as a byte slice

pub fn set_size_hint(&mut self, size_hint: usize)[src]

Set size hint

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

Return true if a size hint is present

pub fn take_size_hint(&mut self) -> Option<usize>[src]

Replace size hint with None and return Some(size_hint)

pub fn peek_size_hint(&self) -> Option<usize>[src]

Return size hint without changing the stream's size hint struct member

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

Check whether the stream has reached the end of the underlying buffer

pub fn rewind(&mut self)[src]

If an error occurs, call this function to rewind to the point in the stream before the last read

pub fn set_at_end(&mut self)[src]

Set cursor to end - this will effectively discard the remaining stream

Trait Implementations

impl<T> AsRef<[u8]> for StreamReadBuffer<T> where
    T: AsRef<[u8]>, 
[src]

impl<T> Read for StreamReadBuffer<T> where
    T: AsRef<[u8]>, 
[src]

Auto Trait Implementations

impl<T> Send for StreamReadBuffer<T> where
    T: Send

impl<T> Unpin for StreamReadBuffer<T> where
    T: Unpin

impl<T> Sync for StreamReadBuffer<T> where
    T: Sync

impl<T> UnwindSafe for StreamReadBuffer<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for StreamReadBuffer<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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.

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

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

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

impl<R> ReadBytesExt for R where
    R: Read + ?Sized
[src]