Struct readahead_iterator::Readahead[][src]

pub struct Readahead<T: Send + 'static> { /* fields omitted */ }

An iterator adaptor that evaluates the iterator on a separate thread, and transports the items back to be consumed from the original thread.

Implementations

impl<T> Readahead<T> where
    T: Send + 'static, 
[src]

pub fn new<I>(inner: I, buffer_size: usize) -> Self where
    I: Iterator<Item = T> + Send + 'static, 
[src]

Apply a threaded readahead to an iterator.

Items from the iterator are produced on a separate thread and passed back to the calling thread.

buffer_size is the maximum number of items that can be buffered.

use readahead_iterator::Readahead;
let c = Readahead::new("Hello Ferris".chars(), 10)
    .filter(|c| c.is_uppercase())
    .count();

Trait Implementations

impl<T> Iterator for Readahead<T> where
    T: Send + 'static, 
[src]

type Item = T

The type of the elements being iterated over.

Auto Trait Implementations

impl<T> !RefUnwindSafe for Readahead<T>

impl<T> Send for Readahead<T>

impl<T> !Sync for Readahead<T>

impl<T> Unpin for Readahead<T>

impl<T> !UnwindSafe for Readahead<T>

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<I, T> IntoReadahead<T> for I where
    T: Send + 'static,
    I: Iterator<Item = 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.