Trait Handler

Source
pub trait Handler<EventError> {
    // Required method
    fn run(
        &mut self,
        event: Vec<u8>,
        ctx: Context,
    ) -> Result<Vec<u8>, EventError>;
}
Expand description

Functions acting as a handler must conform to this type.

Required Methods§

Source

fn run(&mut self, event: Vec<u8>, ctx: Context) -> Result<Vec<u8>, EventError>

Run the handler.

Implementors§

Source§

impl<'ev, Function, EventError> Handler<EventError> for Function
where Function: FnMut(Vec<u8>, Context) -> Result<Vec<u8>, EventError>, EventError: Fail + LambdaErrorExt + Display + Send + Sync,