pub trait Hook:
Send
+ Sync
+ 'static {
// Provided methods
fn before(
&self,
_event: &Event<'_>,
_ctx: &Context,
) -> Result<(), JsonApiError> { ... }
fn after(&self, _event: &Event<'_>, _outcome: &Outcome, _ctx: &Context) { ... }
}Expand description
Something that runs around every operation.
Both methods have a default that does nothing, so a hook implements only
the half it cares about: an audit sink is an after, an authorization
check is a before.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".