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,
Trait Implementations§
impl Copy for Hook
Source§impl<'de> Deserialize<'de> for Hook
impl<'de> Deserialize<'de> for Hook
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Hook
Source§impl Ord for Hook
impl Ord for Hook
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Hook
impl PartialOrd for Hook
impl StructuralPartialEq for Hook
Auto Trait Implementations§
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§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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