pub struct HookMacro {
pub handler: HookHandler,
pub hook_type: HookType,
}Expand description
Represents a route definition created by a macro.
This struct encapsulates the necessary information to register a new hook.
Fields§
§handler: HookHandlerRepresents the asynchronous handler that is executed when the associated hook is triggered.
hook_type: HookTypeRepresents the type of the hook that determines when the handler should be executed.
Implementations§
Source§impl HookMacro
impl HookMacro
pub fn get_handler(&self) -> &HookHandler
pub fn get_hook_type(&self) -> &HookType
Source§impl HookMacro
impl HookMacro
pub fn set_handler(&mut self, val: HookHandler) -> &mut Self
pub fn set_hook_type(&mut self, val: HookType) -> &mut Self
Source§impl HookMacro
impl HookMacro
Sourcepub fn panic_hook<P: ServerHook>(order: Option<isize>) -> Self
pub fn panic_hook<P: ServerHook>(order: Option<isize>) -> Self
Sourcepub fn request_middleware<M: ServerHook>(order: Option<isize>) -> Self
pub fn request_middleware<M: ServerHook>(order: Option<isize>) -> Self
Sourcepub fn response_middleware<M: ServerHook>(order: Option<isize>) -> Self
pub fn response_middleware<M: ServerHook>(order: Option<isize>) -> Self
Trait Implementations§
impl Collect for HookMacro
impl Eq for HookMacro
impl StructuralPartialEq for HookMacro
Auto Trait Implementations§
impl Freeze for HookMacro
impl !RefUnwindSafe for HookMacro
impl Send for HookMacro
impl Sync for HookMacro
impl Unpin for HookMacro
impl !UnwindSafe for HookMacro
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