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 method
fn finish(&mut self) -> Vec<Event> { ... }
}Expand description
파이프라인이 구동하는 리듀서.
session 모듈의 세션 상태가 이 trait 를 구현한다. 세션이 불변 값
(step(&Session, FrameSet) -> (Session, Vec<Event>)) 형태라면 내부에 현재 세션을 들고
step 에서 새 세션으로 교체하는 얇은 어댑터로 구현하면 된다.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".