Struct sfwtools::bytes_iter::BytesIter[][src]

pub struct BytesIter<R: Read> { /* fields omitted */ }

Implementations

impl<R: Read> BytesIter<R>[src]

Inspired by ByteSliceIter, but using new and improved std Iterator trait One downside is that we must clone the buffer due to Iterator’s next signature, which only permits returning Option<Self::Item> and not &Option<Self::Item>. Thus, for applications where the returned buffer slice is only read and not consumed, it may be more efficient to use ByteSliceIter or related approaches.

pub fn new(reader: R, size: usize) -> BytesIter<R>

Notable traits for BytesIter<R>

impl<R: Read> Iterator for BytesIter<R> type Item = Result<Vec<u8>, Error>;
[src]

The default size in std is 8 * 1024.

Trait Implementations

impl<R: Read> Iterator for BytesIter<R>[src]

type Item = Result<Vec<u8>, Error>

The type of the elements being iterated over.

Auto Trait Implementations

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

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

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

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

impl<R> UnwindSafe for BytesIter<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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.