1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
use crate::*;
/// Creates a default `ServerControlHook` 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 default `ServerControlHookHandler` instance.
/// Creates a default `ServerHookHandler` from a trait object.
///
/// # Returns
///
/// - `ServerHookHandler` - A default `ServerHookHandler` instance.
/// Creates a new `ServerHookHandler` from a trait object.
///
/// # Arguments
///
/// - `ServerHook` - The trait object implementing `ServerHook`.
///
/// # Returns
///
/// - `ServerHookHandler` - A new `ServerHookHandler` instance.
/// Verifies that hooks with the same type and execution priority are unique.
///
/// This function validates that no two hooks of the same type have identical
/// execution priorities (orders). Only hooks that define an explicit priority
/// (non-None order) are checked for uniqueness. Hooks without a priority are
/// ignored in duplicate detection.
///
/// # Arguments
///
/// - `Vec<HookType>` - A vector of `HookType` instances to validate for uniqueness.
///
/// # Panics
///
/// - Panics if duplicate hooks are detected with the same type and priority,
/// displaying the hook type and order in the error message.