pub trait FunctionHandler: Send + Sync {
// Required method
fn call(
&self,
context: &mut dyn ContextLike,
args: Vec<Arc<Value>>,
) -> Result<Value>;
}Expand description
Handler invoked for a registered function or method.
Required Methods§
Sourcefn call(
&self,
context: &mut dyn ContextLike,
args: Vec<Arc<Value>>,
) -> Result<Value>
fn call( &self, context: &mut dyn ContextLike, args: Vec<Arc<Value>>, ) -> Result<Value>
Call the function with the provided arguments.
§Arguments
context- The evaluation context for closuresargs- A slice ofValuearguments passed to the function
§Returns
Returns a Result<Value> containing the function result or an error
if the function execution fails.
§Note
For method calls, the first argument is typically the value the method is being called on, followed by any additional arguments.