Skip to main content

Detector

Trait Detector 

Source
pub trait Detector {
    // Required methods
    fn kind(&self) -> DiscordKind;
    fn fires(&self, context: &str) -> bool;
}
Expand description

A detector for a single discord kind. Implementations check whether the kind fires at a given context.

Monotonicity obligation. A detector is monotone if

c_prime -> c  and  fires(c_prime) = true  =>  fires(c) = true

Theorem 4 only applies if every detector in the registry is monotone. Detector authors must establish this property at design time. The substrate cannot prove monotonicity for arbitrary detector implementations; it can only assume the property and report frontier support accordingly.

Required Methods§

Source

fn kind(&self) -> DiscordKind

The discord kind this detector reports.

Source

fn fires(&self, context: &str) -> bool

Whether the kind fires at context.

Implementors§