Skip to main content

ErasedHookCallback

Trait ErasedHookCallback 

Source
pub trait ErasedHookCallback: Send + Sync {
    // Required method
    fn call_erased<'life0, 'async_trait>(
        &'life0 self,
        input: Value,
        context: HookContext,
    ) -> Pin<Box<dyn Future<Output = HookDecision> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Type-erased hook callback. The concrete input type is rebuilt at dispatch time from input.hook_event_name.

Required Methods§

Source

fn call_erased<'life0, 'async_trait>( &'life0 self, input: Value, context: HookContext, ) -> Pin<Box<dyn Future<Output = HookDecision> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deserialise input into the concrete input type and invoke the wrapped callback.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I, C> ErasedHookCallback for ErasedCallback<I, C>
where I: DeserializeOwned + Send + 'static, C: HookCallback<I>,