[][src]Trait amadeus_core::dist_iter::DistributedIterator

pub trait DistributedIterator {
    type Item;
    type Task: Consumer<Item = Self::Item> + ProcessSend;
    fn size_hint(&self) -> (usize, Option<usize>);
fn next_task(&mut self) -> Option<Self::Task>; fn inspect<F>(self, f: F) -> Inspect<Self, F>
    where
        F: FnMut(&Self::Item) + Clone + ProcessSend,
        Self: Sized
, { ... }
fn update<F>(self, f: F) -> Update<Self, F>
    where
        F: FnMut(&mut Self::Item) + Clone + ProcessSend,
        Self: Sized
, { ... }
fn map<B, F>(self, f: F) -> Map<Self, F>
    where
        F: FnMut(Self::Item) -> B + Clone + ProcessSend,
        Self: Sized
, { ... }
fn flat_map<B, F>(self, f: F) -> FlatMap<Self, F>
    where
        F: FnMut(Self::Item) -> B + Clone + ProcessSend,
        B: IntoIterator,
        Self: Sized
, { ... }
fn filter<F>(self, f: F) -> Filter<Self, F>
    where
        F: FnMut(&Self::Item) -> bool + Clone + ProcessSend,
        Self: Sized
, { ... }
fn chain<C>(self, chain: C) -> Chain<Self, C::Iter>
    where
        C: IntoDistributedIterator<Item = Self::Item>,
        Self: Sized
, { ... }
fn reduce<B, R1F, R1, R2>(
        self,
        pool: &impl ProcessPool,
        reduce1factory: R1F,
        reduce2: R2
    ) -> B
    where
        R1F: ReduceFactory<Reducer = R1>,
        R1: ReducerA<Item = Self::Item>,
        R2: Reducer<Item = <R1 as ReducerA>::Output, Output = B>,
        Self: Sized
, { ... }
fn multi<IteratorA, IteratorB, ReducerA, ReducerB, A, B>(
        self,
        pool: &impl ProcessPool,
        reducer_a: ReducerA,
        reducer_b: ReducerB
    ) -> (A, B)
    where
        IteratorA: DistributedIteratorMulti<Self::Item>,
        IteratorB: for<'a> DistributedIteratorMulti<&'a Self::Item> + 'static,
        ReducerA: DistributedReducer<IteratorA, Self::Item, A>,
        ReducerB: for<'a> DistributedReducer<IteratorB, &'a Self::Item, B>,
        Self::Item: 'static,
        Self: Sized
, { ... }
fn for_each<F>(self, pool: &impl ProcessPool, f: F)
    where
        F: FnMut(Self::Item) + Clone + ProcessSend,
        Self::Item: 'static,
        Self: Sized
, { ... }
fn fold<ID, F, B>(self, pool: &impl ProcessPool, identity: ID, op: F) -> B
    where
        ID: FnMut() -> B + Clone + ProcessSend,
        F: FnMut(B, Either<Self::Item, B>) -> B + Clone + ProcessSend,
        B: ProcessSend,
        Self::Item: 'static,
        Self: Sized
, { ... }
fn count(self, pool: &impl ProcessPool) -> usize
    where
        Self::Item: 'static,
        Self: Sized
, { ... }
fn sum<S>(self, pool: &impl ProcessPool) -> S
    where
        S: Sum<Self::Item> + Sum<S> + ProcessSend,
        Self::Item: 'static,
        Self: Sized
, { ... }
fn combine<F>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item>
    where
        F: FnMut(Self::Item, Self::Item) -> Self::Item + Clone + ProcessSend,
        Self::Item: ProcessSend,
        Self: Sized
, { ... }
fn max(self, pool: &impl ProcessPool) -> Option<Self::Item>
    where
        Self::Item: Ord + ProcessSend,
        Self: Sized
, { ... }
fn max_by<F>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item>
    where
        F: FnMut(&Self::Item, &Self::Item) -> Ordering + Clone + ProcessSend,
        Self::Item: ProcessSend,
        Self: Sized
, { ... }
fn max_by_key<F, B>(
        self,
        pool: &impl ProcessPool,
        f: F
    ) -> Option<Self::Item>
    where
        F: FnMut(&Self::Item) -> B + Clone + ProcessSend,
        B: Ord + 'static,
        Self::Item: ProcessSend,
        Self: Sized
, { ... }
fn min(self, pool: &impl ProcessPool) -> Option<Self::Item>
    where
        Self::Item: Ord + ProcessSend,
        Self: Sized
, { ... }
fn min_by<F>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item>
    where
        F: FnMut(&Self::Item, &Self::Item) -> Ordering + Clone + ProcessSend,
        Self::Item: ProcessSend,
        Self: Sized
, { ... }
fn min_by_key<F, B>(
        self,
        pool: &impl ProcessPool,
        f: F
    ) -> Option<Self::Item>
    where
        F: FnMut(&Self::Item) -> B + Clone + ProcessSend,
        B: Ord + 'static,
        Self::Item: ProcessSend,
        Self: Sized
, { ... }
fn most_frequent(
        self,
        pool: &impl ProcessPool,
        n: usize,
        probability: f64,
        tolerance: f64
    ) -> Top<Self::Item, usize>
    where
        Self::Item: Hash + Eq + Clone + ProcessSend,
        Self: Sized
, { ... }
fn most_distinct<A, B>(
        self,
        pool: &impl ProcessPool,
        n: usize,
        probability: f64,
        tolerance: f64,
        error_rate: f64
    ) -> Top<A, HyperLogLogMagnitude<B>>
    where
        Self: DistributedIterator<Item = (A, B)> + Sized,
        A: Hash + Eq + Clone + ProcessSend,
        B: Hash + 'static
, { ... }
fn sample_unstable(
        self,
        pool: &impl ProcessPool,
        samples: usize
    ) -> SampleUnstable<Self::Item>
    where
        Self::Item: ProcessSend,
        Self: Sized
, { ... }
fn all<F>(self, pool: &impl ProcessPool, f: F) -> bool
    where
        F: FnMut(Self::Item) -> bool + Clone + ProcessSend,
        Self::Item: 'static,
        Self: Sized
, { ... }
fn any<F>(self, pool: &impl ProcessPool, f: F) -> bool
    where
        F: FnMut(Self::Item) -> bool + Clone + ProcessSend,
        Self::Item: 'static,
        Self: Sized
, { ... }
fn collect<B>(self, pool: &impl ProcessPool) -> B
    where
        B: FromDistributedIterator<Self::Item>,
        B::ReduceA: ProcessSend,
        Self: Sized
, { ... } }

Associated Types

type Item

type Task: Consumer<Item = Self::Item> + ProcessSend

Loading content...

Required methods

fn size_hint(&self) -> (usize, Option<usize>)

fn next_task(&mut self) -> Option<Self::Task>

Loading content...

Provided methods

fn inspect<F>(self, f: F) -> Inspect<Self, F> where
    F: FnMut(&Self::Item) + Clone + ProcessSend,
    Self: Sized

fn update<F>(self, f: F) -> Update<Self, F> where
    F: FnMut(&mut Self::Item) + Clone + ProcessSend,
    Self: Sized

fn map<B, F>(self, f: F) -> Map<Self, F> where
    F: FnMut(Self::Item) -> B + Clone + ProcessSend,
    Self: Sized

fn flat_map<B, F>(self, f: F) -> FlatMap<Self, F> where
    F: FnMut(Self::Item) -> B + Clone + ProcessSend,
    B: IntoIterator,
    Self: Sized

fn filter<F>(self, f: F) -> Filter<Self, F> where
    F: FnMut(&Self::Item) -> bool + Clone + ProcessSend,
    Self: Sized

fn chain<C>(self, chain: C) -> Chain<Self, C::Iter> where
    C: IntoDistributedIterator<Item = Self::Item>,
    Self: Sized

fn reduce<B, R1F, R1, R2>(
    self,
    pool: &impl ProcessPool,
    reduce1factory: R1F,
    reduce2: R2
) -> B where
    R1F: ReduceFactory<Reducer = R1>,
    R1: ReducerA<Item = Self::Item>,
    R2: Reducer<Item = <R1 as ReducerA>::Output, Output = B>,
    Self: Sized

fn multi<IteratorA, IteratorB, ReducerA, ReducerB, A, B>(
    self,
    pool: &impl ProcessPool,
    reducer_a: ReducerA,
    reducer_b: ReducerB
) -> (A, B) where
    IteratorA: DistributedIteratorMulti<Self::Item>,
    IteratorB: for<'a> DistributedIteratorMulti<&'a Self::Item> + 'static,
    ReducerA: DistributedReducer<IteratorA, Self::Item, A>,
    ReducerB: for<'a> DistributedReducer<IteratorB, &'a Self::Item, B>,
    Self::Item: 'static,
    Self: Sized

fn for_each<F>(self, pool: &impl ProcessPool, f: F) where
    F: FnMut(Self::Item) + Clone + ProcessSend,
    Self::Item: 'static,
    Self: Sized

fn fold<ID, F, B>(self, pool: &impl ProcessPool, identity: ID, op: F) -> B where
    ID: FnMut() -> B + Clone + ProcessSend,
    F: FnMut(B, Either<Self::Item, B>) -> B + Clone + ProcessSend,
    B: ProcessSend,
    Self::Item: 'static,
    Self: Sized

fn count(self, pool: &impl ProcessPool) -> usize where
    Self::Item: 'static,
    Self: Sized

fn sum<S>(self, pool: &impl ProcessPool) -> S where
    S: Sum<Self::Item> + Sum<S> + ProcessSend,
    Self::Item: 'static,
    Self: Sized

fn combine<F>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item> where
    F: FnMut(Self::Item, Self::Item) -> Self::Item + Clone + ProcessSend,
    Self::Item: ProcessSend,
    Self: Sized

fn max(self, pool: &impl ProcessPool) -> Option<Self::Item> where
    Self::Item: Ord + ProcessSend,
    Self: Sized

fn max_by<F>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item> where
    F: FnMut(&Self::Item, &Self::Item) -> Ordering + Clone + ProcessSend,
    Self::Item: ProcessSend,
    Self: Sized

fn max_by_key<F, B>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item> where
    F: FnMut(&Self::Item) -> B + Clone + ProcessSend,
    B: Ord + 'static,
    Self::Item: ProcessSend,
    Self: Sized

fn min(self, pool: &impl ProcessPool) -> Option<Self::Item> where
    Self::Item: Ord + ProcessSend,
    Self: Sized

fn min_by<F>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item> where
    F: FnMut(&Self::Item, &Self::Item) -> Ordering + Clone + ProcessSend,
    Self::Item: ProcessSend,
    Self: Sized

fn min_by_key<F, B>(self, pool: &impl ProcessPool, f: F) -> Option<Self::Item> where
    F: FnMut(&Self::Item) -> B + Clone + ProcessSend,
    B: Ord + 'static,
    Self::Item: ProcessSend,
    Self: Sized

fn most_frequent(
    self,
    pool: &impl ProcessPool,
    n: usize,
    probability: f64,
    tolerance: f64
) -> Top<Self::Item, usize> where
    Self::Item: Hash + Eq + Clone + ProcessSend,
    Self: Sized

fn most_distinct<A, B>(
    self,
    pool: &impl ProcessPool,
    n: usize,
    probability: f64,
    tolerance: f64,
    error_rate: f64
) -> Top<A, HyperLogLogMagnitude<B>> where
    Self: DistributedIterator<Item = (A, B)> + Sized,
    A: Hash + Eq + Clone + ProcessSend,
    B: Hash + 'static, 

fn sample_unstable(
    self,
    pool: &impl ProcessPool,
    samples: usize
) -> SampleUnstable<Self::Item> where
    Self::Item: ProcessSend,
    Self: Sized

fn all<F>(self, pool: &impl ProcessPool, f: F) -> bool where
    F: FnMut(Self::Item) -> bool + Clone + ProcessSend,
    Self::Item: 'static,
    Self: Sized

fn any<F>(self, pool: &impl ProcessPool, f: F) -> bool where
    F: FnMut(Self::Item) -> bool + Clone + ProcessSend,
    Self::Item: 'static,
    Self: Sized

fn collect<B>(self, pool: &impl ProcessPool) -> B where
    B: FromDistributedIterator<Self::Item>,
    B::ReduceA: ProcessSend,
    Self: Sized

Loading content...

Implementations on Foreign Types

impl<A: DistributedIterator, B: DistributedIterator<Item = A::Item>> DistributedIterator for Sum2<A, B>[src]

type Item = A::Item

type Task = Sum2<A::Task, B::Task>

Loading content...

Implementors

impl DistributedIterator for Never[src]

type Item = Self

type Task = Self

impl<A: DistributedIterator, B: DistributedIterator<Item = A::Item>> DistributedIterator for Chain<A, B>[src]

type Item = A::Item

type Task = ChainConsumer<A::Task, B::Task>

impl<I: DistributedIterator, F> DistributedIterator for Filter<I, F> where
    F: FnMut(&I::Item) -> bool + Clone + ProcessSend
[src]

type Item = I::Item

type Task = FilterConsumer<I::Task, F>

impl<I: DistributedIterator, F> DistributedIterator for Inspect<I, F> where
    F: FnMut(&I::Item) + Clone + ProcessSend
[src]

type Item = I::Item

type Task = InspectConsumer<I::Task, F>

impl<I: DistributedIterator, F> DistributedIterator for Update<I, F> where
    F: FnMut(&mut I::Item) + Clone + ProcessSend
[src]

type Item = I::Item

type Task = UpdateConsumer<I::Task, F>

impl<I: DistributedIterator, F, R> DistributedIterator for Map<I, F> where
    F: FnMut(I::Item) -> R + Clone + ProcessSend
[src]

type Item = R

type Task = MapConsumer<I::Task, F>

impl<I: DistributedIterator, F, R: IntoIterator> DistributedIterator for FlatMap<I, F> where
    F: FnMut(I::Item) -> R + Clone + ProcessSend
[src]

type Item = R::Item

type Task = FlatMapConsumer<I::Task, F>

impl<I: Iterator> DistributedIterator for IterIter<I> where
    I::Item: ProcessSend
[src]

type Item = I::Item

type Task = IterIterConsumer<I::Item>

Loading content...