[][src]Struct odds::slice::blocked::BlockedIter

pub struct BlockedIter<'a, B: 'a, T: 'a> { /* fields omitted */ }

An iterator that yields blocks out of the underlying data's range.

A block is a fixed size array of T, and each iteration yields a reference to the next block.

See also the tail methods that provide access to the rest of the elements that did not go up evenly into a block.

Methods

impl<'a, B, T> BlockedIter<'a, B, T> where
    B: Block<Item = T>, 
[src]

pub fn from_slice(data: &'a [T]) -> Self[src]

Create an BlockedIter out of the slice of data, which iterates first in blocks of T, and then leaves a tail of the remaining elements.

pub fn tail(&self) -> SliceIter<'a, T>[src]

Return an iterator of the remaining tail; this can be called at any time, but in particular when the iterator has returned None.

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

Return true if the tail is not empty.

pub fn peek_next(&self) -> Option<Self::Item>[src]

Return the next iterator element, without stepping the iterator.

Trait Implementations

impl<'a, B, T> Clone for BlockedIter<'a, B, T>[src]

impl<'a, B, T> Copy for BlockedIter<'a, B, T>[src]

impl<'a, B: Debug + 'a, T: Debug + 'a> Debug for BlockedIter<'a, B, T>[src]

impl<'a, B, T> ExactSizeIterator for BlockedIter<'a, B, T> where
    B: Block<Item = T>, 
[src]

impl<'a, B, T> Index<usize> for BlockedIter<'a, B, T> where
    B: Block<Item = T>, 
[src]

type Output = B

The returned type after indexing.

impl<'a, B, T> Iterator for BlockedIter<'a, B, T> where
    B: Block<Item = T>, 
[src]

type Item = &'a B

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, B, T> RefUnwindSafe for BlockedIter<'a, B, T> where
    B: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, B, T> !Send for BlockedIter<'a, B, T>

impl<'a, B, T> !Sync for BlockedIter<'a, B, T>

impl<'a, B, T> Unpin for BlockedIter<'a, B, T>

impl<'a, B, T> UnwindSafe for BlockedIter<'a, B, T> where
    B: RefUnwindSafe,
    T: RefUnwindSafe

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.