[][src]Trait cor_iter::Correlate

pub trait Correlate: IntoIterator + Sized {
    fn linear_correlate<I, T>(
        self,
        other: I,
        a: T,
        b: T
    ) -> LinearCorIter<Self::IntoIter, I::IntoIter, T>

Important traits for LinearCorIter<I, J, T>

impl<I, J, T> Iterator for LinearCorIter<I, J, T> where
    I: Iterator,
    J: Iterator,
    T: PrimInt
type Item = Either<I::Item, J::Item>;

    where
        I: IntoIterator,
        T: PrimInt
, { ... }
fn correlate_with<I, F>(
        self,
        other: I,
        function: F
    ) -> CorIter<F, Self::IntoIter, I::IntoIter>

Important traits for CorIter<F, I, J>

impl<F, I, J> Iterator for CorIter<F, I, J> where
    F: FnMut(Either<&I::Item, &J::Item>) -> bool,
    I: Iterator,
    J: Iterator
type Item = Either<I::Item, J::Item>;

    where
        I: IntoIterator,
        F: FnMut(Either<&Self::Item, &I::Item>) -> bool
, { ... } }

Add correlate functionalities to any sized T that implement IntoIterator. The correlate mean that two iterators yield items based on some predefined rule(s).

Provided methods

fn linear_correlate<I, T>(
    self,
    other: I,
    a: T,
    b: T
) -> LinearCorIter<Self::IntoIter, I::IntoIter, T>

Important traits for LinearCorIter<I, J, T>

impl<I, J, T> Iterator for LinearCorIter<I, J, T> where
    I: Iterator,
    J: Iterator,
    T: PrimInt
type Item = Either<I::Item, J::Item>;
where
    I: IntoIterator,
    T: PrimInt

Get an iterator that return Either item from this iterator or other iterator depending on number of item based on given a and b co-efficient.

See LinearCorIter document for more detail on how a and b work.

fn correlate_with<I, F>(
    self,
    other: I,
    function: F
) -> CorIter<F, Self::IntoIter, I::IntoIter>

Important traits for CorIter<F, I, J>

impl<F, I, J> Iterator for CorIter<F, I, J> where
    F: FnMut(Either<&I::Item, &J::Item>) -> bool,
    I: Iterator,
    J: Iterator
type Item = Either<I::Item, J::Item>;
where
    I: IntoIterator,
    F: FnMut(Either<&Self::Item, &I::Item>) -> bool

Return an iterator that return Either item from this iterator or other iterator depending on given function.

It return element from this iterator if function return true. Otherwise, it return an item from secondary iterator. See CorIter for more detail.

Loading content...

Implementors

impl<T> Correlate for T where
    T: IntoIterator
[src]

Loading content...