Skip to main content

Function

Trait Function 

Source
pub trait Function<Res>:
    Sync
    + Send
    + 'static {
    // Required method
    fn call(&self, kwargs: Kwargs, state: &State<'_>) -> Res;

    // Provided method
    fn is_safe(&self) -> bool { ... }
}
Expand description

The function function type definition

Required Methods§

Source

fn call(&self, kwargs: Kwargs, state: &State<'_>) -> Res

The function type definition

Provided Methods§

Source

fn is_safe(&self) -> bool

Whether the current function’s output should be treated as safe, defaults to false Only needs to be defined if the filter returns a string

Implementors§

Source§

impl<Func, Res> Function<Res> for Func
where Func: Fn(Kwargs, &State<'_>) -> Res + Sync + Send + 'static, Res: FunctionResult,