[][src]Type Definition balena_temen::FilterFn

type FilterFn = fn(input: &Value, args: &HashMap<String, Value>, context: &mut Context) -> Result<Value>;

Evaluation engine filter signature

You can register custom filter with the filter method.

Arguments

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

Examples

"hallo" | upper:

  • "hallo" - filter input
  • upper - filter name
  • args - empty map

"hallo" | upper(trim=true)

  • "hallo" - filter input
  • upper - filter name
  • args - map contains trim key with the Value::Boolean(true) value

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