ExternalFunction

Trait ExternalFunction 

Source
pub trait ExternalFunction:
    DynClone
    + Send
    + Sync {
    // Required method
    fn invoke(
        &self,
        state: &mut ExecutionState<'_>,
        args: &[Value],
    ) -> Option<Value>;
}
Expand description

External functions allow external callers to manipulate database state in near-arbitrary ways.

This is a useful, if low-level, interface for extending this database with functionality and state not built into the core model.

Required Methods§

Source

fn invoke( &self, state: &mut ExecutionState<'_>, args: &[Value], ) -> Option<Value>

Invoke the function with mutable access to the database. If a value is not returned, halt the execution of the current rule.

Implementors§