Skip to main content

FunctionImplementation

Trait FunctionImplementation 

Source
pub trait FunctionImplementation:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn return_type(&self) -> ReturnType;
    fn execute(
        &self,
        args: &HashMap<String, Value>,
        context: &DataContext<'_>,
    ) -> Result<Value, A2uiError>;
}
Expand description

A function implementation that can be executed by the A2UI runtime.

Required Methods§

Source

fn name(&self) -> &'static str

The function name as it appears in the catalog.

Source

fn return_type(&self) -> ReturnType

The return type of this function.

Source

fn execute( &self, args: &HashMap<String, Value>, context: &DataContext<'_>, ) -> Result<Value, A2uiError>

Execute the function with resolved arguments.

Args are already resolved (dynamic values evaluated) by the DataContext.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§