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§
Sourcefn before_method_call(
&self,
_call: &MethodCall<'_>,
_context: &mut HookContext<'_, '_>,
) -> HookResult<ExpressionHookResult>
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.
§Errors
Returns [HookError] if the underlying plugin implementation propagates one.
Sourcefn after_method_call(
&self,
_call: &MethodCall<'_>,
_context: &mut HookContext<'_, '_>,
) -> HookResult<()>
fn after_method_call( &self, _call: &MethodCall<'_>, _context: &mut HookContext<'_, '_>, ) -> HookResult<()>
Called after a method call 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".