Skip to main content

StatementHook

Trait StatementHook 

Source
pub trait StatementHook: Provider {
    // Provided methods
    fn before_statement(
        &self,
        _stmt: &Statement<'_>,
        _context: &mut HookContext<'_, '_>,
    ) -> HookResult<HookAction> { ... }
    fn after_statement(
        &self,
        _stmt: &Statement<'_>,
        _context: &mut HookContext<'_, '_>,
    ) -> HookResult<()> { ... }
}
Expand description

Hook trait for intercepting statement analysis.

This hook receives the real AST statement and full mutable context, allowing hooks to inspect statements, report issues, and modify analysis state.

Provided Methods§

Source

fn before_statement( &self, _stmt: &Statement<'_>, _context: &mut HookContext<'_, '_>, ) -> HookResult<HookAction>

Called before a statement is analyzed.

Return HookAction::Continue to proceed with normal analysis, or HookAction::Skip to skip analysis of this statement.

Source

fn after_statement( &self, _stmt: &Statement<'_>, _context: &mut HookContext<'_, '_>, ) -> HookResult<()>

Called after a statement has been analyzed.

Implementors§