pub trait FunctionExecutor: Send + Sync {
// Required methods
fn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_schema(&self) -> FunctionDefinition;
// Provided method
fn validate_arguments(&self, _arguments: &Value) -> Result<()> { ... }
}Expand description
Trait for executing functions
Required Methods§
Sourcefn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the function with given arguments
Sourcefn get_schema(&self) -> FunctionDefinition
fn get_schema(&self) -> FunctionDefinition
Get function schema
Provided Methods§
Sourcefn validate_arguments(&self, _arguments: &Value) -> Result<()>
fn validate_arguments(&self, _arguments: &Value) -> Result<()>
Validate function arguments
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".