[][src]Struct git_features::parallel::EagerIter

pub struct EagerIter<I: Iterator> { /* fields omitted */ }

Evaluate any iterator in their own thread.

This is particularly useful if the wrapped iterator performs IO and/or heavy computations. Use EagerIter::new() for instantiation.

Implementations

impl<I> EagerIter<I> where
    I: Iterator + Send + 'static,
    <I as Iterator>::Item: Send
[src]

pub fn new(iter: I, chunk_size: usize, chunks_in_flight: usize) -> Self[src]

Return a new EagerIter which evaluates iter in its own thread, with a given chunk_size allowing a maximum chunks_in_flight.

  • chunk_size describes how many items returned by iter will be a single item of this EagerIter. This helps to reduce the overhead imposed by transferring many small items. If this number is 1, each item will become a single chunk. 0 is invalid.
  • chunks_in_flight describes how many chunks can be kept in memory in case the consumer of the EagerIters items isn't consuming them fast enough. Setting this number to 0 effectively turns off any caching, but blocks EagerIter if its items aren't consumed fast enough.

Trait Implementations

impl<I> Iterator for EagerIter<I> where
    I: Iterator + Send + 'static,
    <I as Iterator>::Item: Send
[src]

type Item = I::Item

The type of the elements being iterated over.

Auto Trait Implementations

impl<I> !RefUnwindSafe for EagerIter<I>

impl<I> Send for EagerIter<I> where
    <I as Iterator>::Item: Send

impl<I> !Sync for EagerIter<I>

impl<I> Unpin for EagerIter<I> where
    <I as Iterator>::Item: Unpin

impl<I> !UnwindSafe for EagerIter<I>

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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

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.