server-manager 5.0.12

server-manager is a rust library for managing server processes. It encapsulates service startup, shutdown, and background daemon mode. Users can specify the PID file, log file paths, and other configurations through custom settings, while also passing in their own asynchronous server function for execution. The library supports both synchronous and asynchronous operations. On Unix and Windows platforms, it enables background daemon processes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::*;

/// Error type for server management operations.
pub type ServerManagerError = Box<dyn std::error::Error>;

/// Result type for server management operations.
pub type ServerManagerResult = Result<(), ServerManagerError>;

/// Type alias for the hook functions.
pub type ServerManagerHook =
    Arc<dyn Fn() -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync>;