Trait rs_transducers::Reducing
[−]
[src]
pub trait Reducing<I, O, E> { type Item; fn step(&mut self, value: I) -> Result<StepResult, E>; fn complete(&mut self) -> Result<(), E>; fn init(&mut self) { ... } }
Defines a reducing function from I to O with step errors of E
Associated Types
type Item
The type of each value after the reducing function
Required Methods
fn step(&mut self, value: I) -> Result<StepResult, E>
Each step, may fail TODO: the return type to contain an indicator of early termination
fn complete(&mut self) -> Result<(), E>
Transducers must call the underlying complete
Provided Methods
fn init(&mut self)
Transducers must call the underlying init
TODO: may not be required at all. Not currently used by any implementation
Implementors
impl<R, F, I, O, OF, E> Reducing<I, OF, E> for MapReducer<R, F> where F: Fn(I) -> O, R: Reducing<O, OF, E>
impl<R, F, I, O, IO, OF, E> Reducing<I, OF, E> for MapcatReducer<R, F> where IO: IntoIterator<Item=O>, F: Fn(I) -> IO, R: Reducing<O, OF, E>
impl<R, F, I, OF, E> Reducing<I, OF, E> for FilterReducer<R, F> where F: Fn(&I) -> bool, R: Reducing<I, OF, E>
impl<R, I, OF, E> Reducing<I, OF, E> for PartitionReducer<R, I> where R: Reducing<Vec<I>, OF, E>
impl<R, I, OF, E> Reducing<I, OF, E> for TakeReducer<R> where R: Reducing<I, OF, E>
impl<R, I, OF, E, F> Reducing<I, OF, E> for TakeWhileReducer<R, F> where R: Reducing<I, OF, E>, F: Fn(&I) -> bool
impl<R, I, OF, E, F> Reducing<I, OF, E> for DropWhileReducer<R, F> where R: Reducing<I, OF, E>, F: Fn(&I) -> bool
impl<R, I, OF, E> Reducing<I, OF, E> for DropReducer<R> where R: Reducing<I, OF, E>
impl<'a, R, I, OF, E> Reducing<I, OF, E> for ReplaceReducer<R, I> where I: Eq + Hash + Clone, R: Reducing<I, OF, E>
impl<R, I, OF, E, F, X> Reducing<I, OF, E> for PartitionByReducer<R, F, I, X> where R: Reducing<Vec<I>, OF, E>, F: Fn(&I) -> X, X: Eq
impl<'a, O> Reducing<O, Vec<O>, ()> for VecReducer<O>
impl<T> Reducing<T, (), ()> for IterReducer<T>
impl<O> Reducing<O, (), SendError<O>> for SenderReducer<O>