Trait git_features::parallel::Reducer[][src]

pub trait Reducer {
    type Input;
    type Output;
    type Error;
    fn feed(&mut self, item: Self::Input) -> Result<(), Self::Error>;
fn finalize(self) -> Result<Self::Output, Self::Error>; }

An trait for aggregating items into a single result.

Associated Types

type Input[src]

The type fed to the reducer in the feed() method.

type Output[src]

The type produced once by the finalize() method.

type Error[src]

The error type to use for all methods of this trait.

Loading content...

Required methods

fn feed(&mut self, item: Self::Input) -> Result<(), Self::Error>[src]

Called each time a new item was produced in order to aggregate it into the final result.

If an Error is returned, the entire operation will be stopped.

fn finalize(self) -> Result<Self::Output, Self::Error>[src]

Called once once all items where passed to feed(), producing the final Output of the operation or an Error.

Loading content...

Implementors

Loading content...