pub trait Transcoder: Send {
type Input: Send + 'static;
type Output: Send + 'static;
// Required method
fn transcode(&mut self, item: &Self::Input) -> Vec<Self::Output>;
// Provided methods
fn prologue(&mut self) -> Vec<Self::Output> { ... }
fn epilogue(&mut self) -> Vec<Self::Output> { ... }
}Expand description
Stream transcoder: maps an input stream to an output stream.
Stateful, supports 1:N mapping and stream lifecycle hooks. Used for both directions (recv and send) of a protocol endpoint.