Trait rayon::par_iter::internal::Consumer [] [src]

pub trait Consumer<Item>: Send {
    type Folder: Folder<Item, Result=Self::Result>;
    type Reducer: Reducer<Self::Result>;
    type Result: Send;
    fn cost(&mut self, producer_cost: f64) -> f64;
    fn split_at(self, index: usize) -> (Self, Self, Self::Reducer);
    fn into_folder(self) -> Self::Folder;
}

A consumer which consumes items that are fed to it.

Associated Types

type Folder: Folder<Item, Result=Self::Result>

type Reducer: Reducer<Self::Result>

type Result: Send

Required Methods

fn cost(&mut self, producer_cost: f64) -> f64

If it costs producer_cost to produce the items we will consume, returns cost adjusted to account for consuming them.

fn split_at(self, index: usize) -> (Self, Self, Self::Reducer)

Divide the consumer into two consumers, one processing items 0..index and one processing items from index... Also produces a reducer that can be used to reduce the results at the end.

fn into_folder(self) -> Self::Folder

Convert the consumer into a folder that can consume items sequentially, eventually producing a final result.

Implementors