//! Function API and implementation traits for A2UI client-side functions.
usestd::collections::HashMap;usecrate::error::A2uiError;usecrate::model::data_context::DataContext;/// The return type of a function.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]pubenumReturnType{String,
Number,
Boolean,
Array,
Object,
Any,
Void,}/// A function implementation that can be executed by the A2UI runtime.
pubtraitFunctionImplementation: Send + Sync + 'static {/// The function name as it appears in the catalog.
fnname(&self)->&'staticstr;/// The return type of this function.
fnreturn_type(&self)-> ReturnType;/// Execute the function with resolved arguments.
////// Args are already resolved (dynamic values evaluated) by the DataContext.
fnexecute(&self,
args:&HashMap<String, serde_json::Value>,
context:&DataContext,
)->Result<serde_json::Value, A2uiError>;}