Skip to main content

Filter

Trait Filter 

Source
pub trait Filter: Sync + Send {
    // Required method
    fn filter(
        &self,
        value: &Value,
        args: &HashMap<String, Value>,
    ) -> Result<Value, Error>;

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

The filter function type definition

Required Methods§

Source

fn filter( &self, value: &Value, args: &HashMap<String, Value>, ) -> Result<Value, Error>

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> Filter for F
where F: Fn(&Value, &HashMap<String, Value>) -> Result<Value, Error> + Sync + Send,