pub trait HookCallback<I>: Send + Syncwhere
I: Send + 'static,{
// Required method
fn call<'a>(
&'a self,
input: I,
context: HookContext,
) -> Pin<Box<dyn Future<Output = HookDecision> + Send + 'a>>;
}Expand description
Trait for hook callbacks. Each hook kind has its own concrete callback; the trait is parameterised over the input type.
Required Methods§
Sourcefn call<'a>(
&'a self,
input: I,
context: HookContext,
) -> Pin<Box<dyn Future<Output = HookDecision> + Send + 'a>>
fn call<'a>( &'a self, input: I, context: HookContext, ) -> Pin<Box<dyn Future<Output = HookDecision> + Send + 'a>>
Called when the matching hook fires.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".