Skip to main content

L2Engine

Trait L2Engine 

Source
pub trait L2Engine: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn finding_types(&self) -> &[&'static str];
    fn analyze(&self, ctx: &L2Context) -> L2AnalyzerOutput;

    // Provided method
    fn languages(&self) -> &[Language] { ... }
}
Expand description

Trait for L2 deep-analysis engines.

Implementations must be object-safe so they can be stored as Box<dyn L2Engine> in the engine registry. Each engine declares:

  • A unique name for logging and identification
  • The finding types it can produce (e.g., ["null-deref", "uninitialized-read"])
  • Which languages it supports (empty means language-agnostic)
  • The analysis entry point

Required Methods§

Source

fn name(&self) -> &'static str

Unique human-readable name for this engine (used in logging and reports).

Source

fn finding_types(&self) -> &[&'static str]

The set of finding type identifiers this engine can produce.

Source

fn analyze(&self, ctx: &L2Context) -> L2AnalyzerOutput

Run analysis on the provided context and return findings.

Provided Methods§

Source

fn languages(&self) -> &[Language]

Languages this engine supports. An empty slice means language-agnostic (the engine handles all languages or performs language-independent analysis).

Implementors§