pub trait FuncallHandler {
// Required methods
fn call_function(
&mut self,
context: &mut Context,
func: JsonnetValue,
args: Vec<JsonnetValue>,
) -> Result<JsonnetValue>;
fn is_builtin_function(&self, name: &str) -> bool;
fn call_builtin_function(
&mut self,
context: &mut Context,
name: &str,
args: Vec<JsonnetValue>,
) -> Result<JsonnetValue>;
fn is_external_function(&self, name: &str) -> bool;
fn call_external_function(
&mut self,
context: &mut Context,
name: &str,
args: Vec<JsonnetValue>,
) -> Result<JsonnetValue>;
}
Expand description
Handler for function calls (user-defined, builtin, external)
Required Methods§
Sourcefn call_function(
&mut self,
context: &mut Context,
func: JsonnetValue,
args: Vec<JsonnetValue>,
) -> Result<JsonnetValue>
fn call_function( &mut self, context: &mut Context, func: JsonnetValue, args: Vec<JsonnetValue>, ) -> Result<JsonnetValue>
Call a function with given arguments
Sourcefn is_builtin_function(&self, name: &str) -> bool
fn is_builtin_function(&self, name: &str) -> bool
Check if a function name refers to a builtin function
Sourcefn call_builtin_function(
&mut self,
context: &mut Context,
name: &str,
args: Vec<JsonnetValue>,
) -> Result<JsonnetValue>
fn call_builtin_function( &mut self, context: &mut Context, name: &str, args: Vec<JsonnetValue>, ) -> Result<JsonnetValue>
Call a builtin function
Sourcefn is_external_function(&self, name: &str) -> bool
fn is_external_function(&self, name: &str) -> bool
Check if a function name refers to an external function
Sourcefn call_external_function(
&mut self,
context: &mut Context,
name: &str,
args: Vec<JsonnetValue>,
) -> Result<JsonnetValue>
fn call_external_function( &mut self, context: &mut Context, name: &str, args: Vec<JsonnetValue>, ) -> Result<JsonnetValue>
Call an external function (HTTP, AI API, system commands, etc.)