Skip to main content

WafModule

Trait WafModule 

Source
pub trait WafModule: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn phase(&self) -> Phase;
    fn init(&mut self, cfg: &Config);
    fn inspect(&self, ctx: &RequestContext) -> Decision;

    // Provided method
    fn structural(&self) -> bool { ... }
}

Required Methods§

Source

fn id(&self) -> &str

Source

fn phase(&self) -> Phase

Source

fn init(&mut self, cfg: &Config)

Called once at startup; compile/init rules here, never in inspect.

Source

fn inspect(&self, ctx: &RequestContext) -> Decision

Read-only access to context; pipeline owns mutation of score.

Provided Methods§

Source

fn structural(&self) -> bool

true for a STRUCTURAL inspection module (e.g. GraphQL) whose decision does NOT come from a content-rule match. The content fast-path (Pillar 3) may prove “no content rule can match” and skip CONTENT inspection — but it cannot prove a structural module is inert, so structural modules run even on the skip path. Default false (a content module, gated by the fast-path).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§