Trait PredicateImpl

Source
pub trait PredicateImpl {
    // Required method
    fn evaluate(
        &self,
        data: &Value,
        ctx: PredicateContext,
    ) -> Result<bool, PredicateError>;

    // Provided method
    fn test(&self, data: &Value, ctx: PredicateContext) -> bool { ... }
}

Required Methods§

Source

fn evaluate( &self, data: &Value, ctx: PredicateContext, ) -> Result<bool, PredicateError>

Evaluate the predicate against the provided JSON

The error result means the predicate couldn’t be evaluated properly so you have to assume it’s a false result and you’ll also have more information about why it didn’t validate.

Provided Methods§

Source

fn test(&self, data: &Value, ctx: PredicateContext) -> bool

Evaluate the predicate against the provided JSON

Implementors§