Skip to main content

MethodCallHook

Trait MethodCallHook 

Source
pub trait MethodCallHook: Provider {
    // Provided methods
    fn before_method_call(
        &self,
        _call: &MethodCall<'_>,
        _context: &mut HookContext<'_, '_>,
    ) -> HookResult<ExpressionHookResult> { ... }
    fn after_method_call(
        &self,
        _call: &MethodCall<'_>,
        _context: &mut HookContext<'_, '_>,
    ) -> HookResult<()> { ... }
}
Expand description

Hook trait for intercepting method call analysis.

This hook receives the real AST method call node and full mutable context, allowing hooks to inspect calls, report issues, modify analysis state, and optionally skip analysis with a custom return type.

Provided Methods§

Source

fn before_method_call( &self, _call: &MethodCall<'_>, _context: &mut HookContext<'_, '_>, ) -> HookResult<ExpressionHookResult>

Called before a method call is analyzed.

Return ExpressionHookResult::Continue to proceed with normal analysis, ExpressionHookResult::Skip to skip analysis (type will be mixed), or ExpressionHookResult::SkipWithType(ty) to skip with a custom return type.

Source

fn after_method_call( &self, _call: &MethodCall<'_>, _context: &mut HookContext<'_, '_>, ) -> HookResult<()>

Called after a method call has been analyzed.

Implementors§