Skip to main content

UdfPlugin

Trait UdfPlugin 

Source
pub trait UdfPlugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn min_arity(&self) -> usize;
    fn max_arity(&self) -> usize;
    fn is_pure(&self) -> bool;
    fn execute(&self, args: &[Value]) -> Result<Value, ExpressionError>;
}
Expand description

Plugin interface implemented by user defined functions.

The trait mirrors the metadata required by CustomFunction so a plugin can be registered without additional glue code. Only argument values and the return value cross the library boundary; plugins never observe database internals.

Required Methods§

Source

fn name(&self) -> &str

Function name used for registration (case-insensitive).

Source

fn description(&self) -> &str

Human readable description.

Source

fn min_arity(&self) -> usize

Minimum number of accepted arguments.

Source

fn max_arity(&self) -> usize

Maximum number of accepted arguments.

Source

fn is_pure(&self) -> bool

Whether the function is deterministic (same input always yields same output).

Source

fn execute(&self, args: &[Value]) -> Result<Value, ExpressionError>

Execute the function.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§