#[non_exhaustive]pub enum Hook {
Routed,
Finish,
BeforeRender,
}Expand description
A named point in the pipeline where registered code runs, only for the routes it registered for. A route with no hooks pays nothing.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Routed
After the access check passed, before the handler: locale, feature flags, an A/B variant. An error ends the request.
Finish
After the handler succeeded, before the reply leaves: add headers. An error replaces the reply with the error page.
BeforeRender
Inside Cx::render, before the engine runs: choose a variant, add
headers. A hook that renders does not run these hooks again.
Trait Implementations§
impl Copy for Hook
impl Eq for Hook
impl StructuralPartialEq for Hook
Auto Trait Implementations§
impl Forget for Hook
impl Freeze for Hook
impl RefUnwindSafe for Hook
impl Send for Hook
impl Sync for Hook
impl Unpin for Hook
impl UnsafeUnpin for Hook
impl UnwindSafe for Hook
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more