Skip to main content

server_manager/
struct.rs

1use super::*;
2
3/// Main structure for managing server processes.
4///
5/// Accessors are generated by `#[derive(Data)]`. The setters take owned `String` /
6/// `ServerManagerHook` values, so call sites convert `&str` and closures themselves.
7#[derive(Clone, Data)]
8pub struct ServerManager {
9    /// Path to the PID file for process tracking.
10    pub(crate) pid_file: String,
11    /// An asynchronous function to be called before stopping the server.
12    pub(crate) stop_hook: ServerManagerHook,
13    /// An asynchronous function to be called before starting the server.
14    pub(crate) start_hook: ServerManagerHook,
15    /// Server function to be executed.
16    pub(crate) server_hook: ServerManagerHook,
17}