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§
Sourcefn before_statement(
&self,
_stmt: &Statement<'_>,
_context: &mut HookContext<'_, '_>,
) -> HookResult<HookAction>
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.
§Errors
Returns [HookError] if the underlying plugin implementation propagates one.
Sourcefn after_statement(
&self,
_stmt: &Statement<'_>,
_context: &mut HookContext<'_, '_>,
) -> HookResult<()>
fn after_statement( &self, _stmt: &Statement<'_>, _context: &mut HookContext<'_, '_>, ) -> HookResult<()>
Called after a statement has been analyzed.
§Errors
Returns [HookError] if the underlying plugin implementation propagates one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".