pub struct HttpServer { /* private fields */ }Expand description
An opaque handle to the running HTTP server.
Implements Task so it can be passed to the crate::run! macro for
coordinated graceful shutdown alongside other services.
Obtain a handle by calling http().
Trait Implementations§
Source§impl Task for HttpServer
impl Task for HttpServer
Source§async fn shutdown(self) -> Result<()>
async fn shutdown(self) -> Result<()>
Signal the server to stop accepting new connections and wait for in-flight requests to drain.
If the drain does not complete within shutdown_timeout_secs (from
Config), a warning is logged and the function still returns
Ok(()) — shutdown is best-effort.
§Errors
This implementation is infallible and always returns Ok(()); the
Result signature comes from the Task trait.
Auto Trait Implementations§
impl Freeze for HttpServer
impl !RefUnwindSafe for HttpServer
impl Send for HttpServer
impl Sync for HttpServer
impl Unpin for HttpServer
impl UnsafeUnpin for HttpServer
impl !UnwindSafe for HttpServer
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