[][src]Type Definition balena_temen::FilterFn

type FilterFn = fn(input: &Value, args: &[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 slice

"hallo" | upper(true)

  • "hallo" - filter input
  • upper - filter name
  • args - slice contains Value::Boolean(true) as a first item

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