pub struct FilterConfig {
pub condition: Value,
pub on_reject: RejectAction,
pub compiled_condition: Option<Arc<Logic>>,
}Expand description
Configuration for the filter/gate function
Fields§
§condition: ValueJSONLogic condition to evaluate against the message context. If true, the message passes through. If false, the on_reject action is taken.
on_reject: RejectActionWhat to do when the condition is false
compiled_condition: Option<Arc<Logic>>Pre-compiled JSONLogic, populated by LogicCompiler. None is
treated as “condition not met” (same fallback as before).
Implementations§
Source§impl FilterConfig
impl FilterConfig
Sourcepub fn execute(
&self,
message: &mut Message,
engine: &Arc<Engine>,
) -> Result<(TaskOutcome, Vec<Change>)>
pub fn execute( &self, message: &mut Message, engine: &Arc<Engine>, ) -> Result<(TaskOutcome, Vec<Change>)>
Execute the filter function, opening a fresh thread-local arena scope.
Use this entry point when calling FilterConfig outside an existing
with_arena scope. Inside a workflow sync stretch the dispatch goes
through Self::execute_in_arena to reuse the cached arena form of
message.context and avoid a redundant to_arena deep walk.
Returns TaskOutcome::Success when the condition passes,
TaskOutcome::Halt / TaskOutcome::Skip per on_reject otherwise.
Trait Implementations§
Source§impl Clone for FilterConfig
impl Clone for FilterConfig
Source§fn clone(&self) -> FilterConfig
fn clone(&self) -> FilterConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more