FunctionHandler

Trait FunctionHandler 

Source
pub trait FunctionHandler: Send + Sync {
    // Required method
    fn execute(
        &self,
        message: &mut Message,
        config: &FunctionConfig,
        datalogic: &DataLogic<'_>,
    ) -> Result<(usize, Vec<Change>)>;
}
Expand description

Interface for task functions that operate on messages

§Usage

Implement this trait for custom processing logic. The function receives:

  • Mutable access to the message being processed
  • Pre-parsed function configuration
  • Reference to the DataLogic instance for JSONLogic evaluation

Required Methods§

Source

fn execute( &self, message: &mut Message, config: &FunctionConfig, datalogic: &DataLogic<'_>, ) -> Result<(usize, Vec<Change>)>

Execute the function on a message with pre-parsed configuration

§Arguments
  • message - The message to process
  • config - Pre-parsed function configuration
  • datalogic - Reference to DataLogic instance for JSONLogic evaluation
§Returns
  • Result<(usize, Vec<Change>)> - Result containing status code and changes, or error

Implementors§