Skip to main content

Filter

Trait Filter 

Source
pub trait Filter<Arg, Res>:
    Sync
    + Send
    + 'static
where Res: FunctionResult,
{ // Required method fn call(&self, value: Arg, kwargs: Kwargs, state: &State<'_>) -> Res; // Provided method fn is_safe(&self) -> bool { ... } }
Expand description

The filter function type definition

Required Methods§

Source

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

The filter function type definition

Provided Methods§

Source

fn is_safe(&self) -> bool

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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