Skip to main content

ContextHook

Trait ContextHook 

Source
pub trait ContextHook: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn definition_fingerprint(&self) -> String;
    fn apply<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        context: &'life1 ExtensionContext,
        event: &'life2 ContextEvent,
        frame: &'life3 ContextFrame,
    ) -> Pin<Box<dyn Future<Output = Result<ContextPatch, ExtensionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn definition_fingerprint(&self) -> String

Stable authoring fingerprint for the Hook implementation/configuration.

The Definition builder incorporates this value into its immutable digest. Change it whenever Hook behavior or embedded static resources change. Per-execution dynamic resource content still carries its own ContextResource.digest at runtime.

Source

fn apply<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 ExtensionContext, event: &'life2 ContextEvent, frame: &'life3 ContextFrame, ) -> Pin<Box<dyn Future<Output = Result<ContextPatch, ExtensionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§