StatefulStage

Trait StatefulStage 

pub trait StatefulStage {
    // Required method
    fn call(
        &mut self,
        input: &[u8],
        output: &mut [u8],
    ) -> Result<usize, Box<dyn Error + Send + Sync>>;
}
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§

fn call( &mut self, input: &[u8], output: &mut [u8], ) -> Result<usize, Box<dyn Error + Send + Sync>>

Transform input into output.

Returns the number of bytes written to output.

Implementations on Foreign Types§

Source§

impl StatefulStage for ExecStage

Source§

fn call( &mut self, input: &[u8], output: &mut [u8], ) -> Result<usize, Box<dyn Error + Send + Sync>>

Source§

impl StatefulStage for HttpPostStage

Source§

fn call( &mut self, input: &[u8], output: &mut [u8], ) -> Result<usize, Box<dyn Error + Send + Sync>>

Implementors§