pub struct Hook;Expand description
Namespace for hook handler factory and utility functions.
This zero-size struct provides associated functions for creating and managing hook handlers in a semantically organized way.
Implementations§
Source§impl Hook
Factory and utility functions for creating hook handlers.
impl Hook
Factory and utility functions for creating hook handlers.
This impl block groups semantically related factory methods that create various hook handler types used throughout the server lifecycle.
Sourcepub fn default_control_handler() -> ServerControlHookHandler<()>
pub fn default_control_handler() -> ServerControlHookHandler<()>
Creates a default ServerControlHookHandler instance with default no-op hooks.
The default wait_hook and shutdown_hook do nothing, allowing the server
to run without specific shutdown or wait logic unless configured otherwise.
§Returns
ServerControlHookHandler<()>- A defaultServerControlHookHandler<()>instance.
Sourcepub fn default_handler() -> ServerHookHandler
pub fn default_handler() -> ServerHookHandler
Creates a default ServerHookHandler from a trait object.
§Returns
ServerHookHandler- A defaultServerHookHandlerinstance.
Sourcepub fn factory<R>() -> ServerHookHandlerwhere
R: ServerHook,
pub fn factory<R>() -> ServerHookHandlerwhere
R: ServerHook,
Creates a new ServerHookHandler from a trait object.
The hook implementation is chosen by the caller through the type
parameter R, so this function takes no runtime argument.
§Returns
ServerHookHandler- A newServerHookHandlerinstance.