pub struct ServerManager<F> { /* private fields */ }Expand description
Title: ServerManager structure for managing the server process
Parameters:
- None
Returns:
- None
This structure encapsulates the server management operations and holds the user-provided configuration and the server function.
Implementations§
Source§impl<F, Fut> ServerManager<F>
impl<F, Fut> ServerManager<F>
Sourcepub fn new(config: ServerConfigManager, server_fn: F) -> Self
pub fn new(config: ServerConfigManager, server_fn: F) -> Self
Title: Create a new ServerManager instance
Parameters:
config: The server configuration containing PID file path and log paths.server_fn: A closure representing the asynchronous server function.
Returns:
ServerManager<F>: A new instance of ServerManager.
Sourcepub async fn start(&self)
pub async fn start(&self)
Title: Start the server in foreground mode
Parameters:
- None
Returns:
(): No return value.
This function writes the current process ID to the PID file specified in the configuration and then runs the server function asynchronously.
Auto Trait Implementations§
impl<F> Freeze for ServerManager<F>where
F: Freeze,
impl<F> RefUnwindSafe for ServerManager<F>where
F: RefUnwindSafe,
impl<F> Send for ServerManager<F>where
F: Send,
impl<F> Sync for ServerManager<F>where
F: Sync,
impl<F> Unpin for ServerManager<F>where
F: Unpin,
impl<F> UnwindSafe for ServerManager<F>where
F: UnwindSafe,
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