oneline_template/function_executor/
function_executor.rs

1use crate::function_executor::value::Value;
2use crate::function_executor::function_schema::FunctionSchema;
3use crate::function_executor::function_error::FunctionError;
4
5
6/// Executes function.
7pub trait FunctionExecutor {
8    /// Returns function schema that contain information about function: function name and argument types.
9    fn schema(&self) -> FunctionSchema;
10    /// Executes function.
11    /// * `input` value that retrieved from field or other function executor.
12    /// * `arguments` list of arguments that was declared within template.
13    fn call(&self, input: Value, arguments: &[Value]) -> Result<Value, FunctionError>;
14}