Skip to main content

ConstraintEvaluator

Trait ConstraintEvaluator 

Source
pub trait ConstraintEvaluator {
    // Required method
    fn evaluate(
        &self,
        constraint: &Constraint,
        cert_id: &str,
        context: &VerifierContext<'_>,
        now: i64,
    ) -> Result<(), String>;
}
Expand description

Pluggable evaluator for extension constraint types (SPEC §17.7).

Built-in types (geo_, time_window, max_) are evaluated by the SDK directly; an evaluator is consulted only for types the SDK does not natively understand. Returning Ok(true) allows; Ok(false) denies as constraint_denied; Err("constraint_unverifiable: ...") routes to constraint_unverifiable; other Err(...) denies with the wrapped reason.

Required Methods§

Source

fn evaluate( &self, constraint: &Constraint, cert_id: &str, context: &VerifierContext<'_>, now: i64, ) -> Result<(), String>

Implementors§