pub struct ServerManager { /* private fields */ }Expand description
Main structure for managing server processes.
Encapsulates all server management operations and holds necessary configuration.
Implementations§
Source§impl ServerManager
Implementation of server management operations.
impl ServerManager
Implementation of server management operations.
Provides methods for starting, stopping and managing server processes.
pub fn new() -> Self
pub fn set_pid_file<P: ToString>(&mut self, pid_file: P) -> &mut Self
pub fn set_start_hook<F, Fut>(&mut self, f: F) -> &mut Self
pub fn set_server_hook<F, Fut>(&mut self, f: F) -> &mut Self
pub fn set_stop_hook<F, Fut>(&mut self, f: F) -> &mut Self
pub fn get_pid_file(&self) -> &str
pub fn get_start_hook(&self) -> &Hook
pub fn get_server_hook(&self) -> &Hook
pub fn get_stop_hook(&self) -> &Hook
Sourcepub async fn start(&self)
pub async fn start(&self)
Starts the server in foreground mode.
Writes the current process ID to the PID file and executes the server function.
Sourcepub async fn stop(&self) -> ServerManagerResult
pub async fn stop(&self) -> ServerManagerResult
Stops the running server process.
Reads PID from file and terminates the process.
§Returns
ServerManagerResult- Operation result.
Sourcepub async fn start_daemon(&self) -> ServerManagerResult
pub async fn start_daemon(&self) -> ServerManagerResult
Starts the server in daemon (background) mode on Unix platforms.
Sourcepub async fn hot_restart(&self, run_args: &[&str]) -> ServerManagerResult
pub async fn hot_restart(&self, run_args: &[&str]) -> ServerManagerResult
Sourcepub async fn hot_restart_wait(&self, run_args: &[&str]) -> ServerManagerResult
pub async fn hot_restart_wait(&self, run_args: &[&str]) -> ServerManagerResult
Trait Implementations§
Source§impl Clone for ServerManager
impl Clone for ServerManager
Source§fn clone(&self) -> ServerManager
fn clone(&self) -> ServerManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerManager
impl !RefUnwindSafe for ServerManager
impl Send for ServerManager
impl Sync for ServerManager
impl Unpin for ServerManager
impl !UnwindSafe for ServerManager
Blanket Implementations§
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