Type Definition balena_temen::FunctionFn

source ·
pub type FunctionFn = fn(args: &HashMap<String, Value>, context: &mut Context) -> Result<Value>;
Expand description

Evaluation engine function signature

You can register custom function with the function method.

Arguments

  • args - A function arguments
  • context - An evaluation context

Examples

random():

  • random - function name
  • args - empty map

random(max=1024)

  • random - function name
  • args - map contains max key with the Value::Number(1024) value

Visit function method documentation to see how to register custom function and how it should look like.