Struct byte::Iter[][src]

#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]pub struct Iter<'a, 'i, T, Ctx> where
    T: TryRead<'a, Ctx>,
    Ctx: Clone
{ /* fields omitted */ }

Iterator that read values of same type from bytes.

Example

use byte::*;
use byte::ctx::*;

let bytes: &[u8] = b"hello\0world\0dead\0beef\0more";
let mut offset = 0;
{
    let mut iter = bytes.read_iter(&mut offset, Str::Delimiter(NULL));
    assert_eq!(iter.next(), Some("hello"));
    assert_eq!(iter.next(), Some("world"));
    assert_eq!(iter.next(), Some("dead"));
    assert_eq!(iter.next(), Some("beef"));
    assert_eq!(iter.next(), None);
}
assert_eq!(offset, 22);

Trait Implementations

impl<'a, 'i, T, Ctx> Iterator for Iter<'a, 'i, T, Ctx> where
    T: TryRead<'a, Ctx>,
    Ctx: Clone
[src]

type Item = T

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, 'i, T, Ctx> Send for Iter<'a, 'i, T, Ctx> where
    Ctx: Send,
    T: Send

impl<'a, 'i, T, Ctx> Sync for Iter<'a, 'i, T, Ctx> where
    Ctx: Sync,
    T: Sync

impl<'a, 'i, T, Ctx> Unpin for Iter<'a, 'i, T, Ctx> where
    Ctx: Unpin,
    T: Unpin

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.