pub struct ServerManager { /* private fields */ }Expand description
Main structure for managing server processes.
Accessors are generated by #[derive(Data)]. The setters take owned String /
ServerManagerHook values, so call sites convert &str and closures themselves.
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.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ServerManager instance.
This is a convenience method that calls ServerManager::default().
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.
§Returns
ServerManagerResult- Operation result.
Sourcepub async fn watch_detached(&self, run_args: &[&str]) -> ServerManagerResult
pub async fn watch_detached(&self, run_args: &[&str]) -> ServerManagerResult
Sourcepub async fn watch(&self, run_args: &[&str]) -> ServerManagerResult
pub async fn watch(&self, run_args: &[&str]) -> ServerManagerResult
Source§impl ServerManager
impl ServerManager
pub fn get_pid_file(&self) -> &String
pub fn get_mut_pid_file(&mut self) -> &mut String
pub fn set_pid_file(&mut self, val: String) -> &mut Self
pub fn get_stop_hook(&self) -> &ServerManagerHook
pub fn get_mut_stop_hook(&mut self) -> &mut ServerManagerHook
pub fn set_stop_hook(&mut self, val: ServerManagerHook) -> &mut Self
pub fn get_start_hook(&self) -> &ServerManagerHook
pub fn get_mut_start_hook(&mut self) -> &mut ServerManagerHook
pub fn set_start_hook(&mut self, val: ServerManagerHook) -> &mut Self
pub fn get_server_hook(&self) -> &ServerManagerHook
pub fn get_mut_server_hook(&mut self) -> &mut ServerManagerHook
pub fn set_server_hook(&mut self, val: ServerManagerHook) -> &mut Self
Trait Implementations§
Source§impl Clone for ServerManager
impl Clone for ServerManager
Auto Trait Implementations§
impl !RefUnwindSafe for ServerManager
impl !UnwindSafe for ServerManager
impl Freeze for ServerManager
impl Send for ServerManager
impl Sync for ServerManager
impl Unpin for ServerManager
impl UnsafeUnpin 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