pub struct WebServerManager { /* private fields */ }Expand description
Manages one or more web servers started from WebServerConfig entries.
Handles both command-based dev servers and static file servers.
Implementations§
Source§impl WebServerManager
impl WebServerManager
Sourcepub async fn start(configs: &[WebServerConfig]) -> Result<Self>
pub async fn start(configs: &[WebServerConfig]) -> Result<Self>
Start all configured web servers. Returns the URL of the first server
(for use as base_url).
§Errors
Returns an error if any server fails to start or become ready.
Sourcepub fn test_server(&self) -> Option<&TestServer>
pub fn test_server(&self) -> Option<&TestServer>
Get the TestServer instance (for programmatic routes), if the first server is static.
Sourcepub async fn stop(self)
pub async fn stop(self)
Stop all servers. When a Command-mode server has
graceful_shutdown configured, the manager sends the soft signal
(SIGINT or SIGTERM) first and waits up to timeout ms before
escalating to SIGKILL. Without graceful_shutdown, the child
is killed immediately (preserving prior behaviour).
Auto Trait Implementations§
impl Freeze for WebServerManager
impl !RefUnwindSafe for WebServerManager
impl Send for WebServerManager
impl Sync for WebServerManager
impl Unpin for WebServerManager
impl UnsafeUnpin for WebServerManager
impl !UnwindSafe for WebServerManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more