Skip to main content

CommitHook

Trait CommitHook 

Source
pub trait CommitHook: Send + Sync {
    // Required method
    fn handle(
        &self,
        event: &RequestEvent,
    ) -> Result<HookDecision, HookHandlerError>;
}
Expand description

Synchronous Rust hook. Async hosts should drive prepare_commit and resolve_commit around their own executor instead of blocking the runtime.

Required Methods§

Source

fn handle(&self, event: &RequestEvent) -> Result<HookDecision, HookHandlerError>

Return a decision from immutable evidence without mutating runtime state.

§Errors

Returns HookHandlerError when the host-owned handler cannot produce a trustworthy decision. The runtime then keeps the transaction pending.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§