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§
Sourcefn evaluate(
&self,
data: &Value,
ctx: PredicateContext,
) -> Result<bool, PredicateError>
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§
Sourcefn test(&self, data: &Value, ctx: PredicateContext) -> bool
fn test(&self, data: &Value, ctx: PredicateContext) -> bool
Evaluate the predicate against the provided JSON