StatefulStage

Trait StatefulStage 

Source
pub trait StatefulStage {
    // Required method
    fn call(
        &mut self,
        input: &[u8],
        output: &mut [u8],
    ) -> Result<usize, StageError>;
}
Expand description

Stateful stage implementation.

This is the explicit opt-in path for stages that need internal mutable state.

Important: executors call this once per message via dyn, so this is inherently slower than function-pointer based variants.

Required Methods§

Source

fn call(&mut self, input: &[u8], output: &mut [u8]) -> Result<usize, StageError>

Transform input into output.

Returns the number of bytes written to output.

Implementors§