pub trait Reducer {
type Input;
// Required methods
fn step(&mut self, input: Self::Input) -> Vec<Event>;
fn poll(&mut self) -> Vec<Event>;
fn command(&mut self, c: Command) -> Vec<Event>;
// Provided methods
fn prelude(&mut self, _input: &Self::Input) -> Vec<Event> { ... }
fn finish(&mut self) -> Vec<Event> { ... }
}Expand description
The reducer driven by the pipeline.
The session state of the session module implements this trait. If the session has the immutable-value form
(step(&Session, FrameSet) -> (Session, Vec<Event>)), implement it as a thin adapter that holds the current session
and replaces it with the new session in step.
Required Associated Types§
Required Methods§
Sourcefn step(&mut self, input: Self::Input) -> Vec<Event>
fn step(&mut self, input: Self::Input) -> Vec<Event>
Process one input and return the resulting events in order.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".