register_custom_function

Function register_custom_function 

Source
pub fn register_custom_function<F>(
    tera: &mut Tera,
    name: &str,
    func: F,
) -> Result<()>
where F: Fn(&HashMap<String, Value>) -> Result<Value> + Send + Sync + 'static,
Expand description

Convenience functions for registering custom functions and filters

Register a custom function with Tera

ยงArguments

  • tera - Tera instance to register with
  • name - Function name for template usage
  • func - Function implementation