pub struct BoundHttpServer { /* private fields */ }Expand description
A bound, caller-owned HTTP server lifecycle.
The listener and every accepted connection stay in the caller’s Cx
region. Dropping the lifecycle closes its listener; cancelling that region
cancels the accept loop and all of its connection children together.
Implementations§
Source§impl BoundHttpServer
impl BoundHttpServer
Sourcepub fn local_addr(&self) -> McpResult<SocketAddr>
pub fn local_addr(&self) -> McpResult<SocketAddr>
Returns the address selected by the operating system for this listener.
Sourcepub async fn serve(self, cx: &Cx) -> McpResult<HttpServerShutdown>
pub async fn serve(self, cx: &Cx) -> McpResult<HttpServerShutdown>
Accepts real HTTP/1.1 loopback or network connections until the caller cancels the owning context.
Cooperative connection children are joined during shutdown. If a
synchronous handler ignores cancellation, this method returns
HttpServerShutdown::Nonquiescent after
[HTTP_CONNECTION_SHUTDOWN_TIMEOUT] instead of claiming a clean
shutdown. The caller owns the returned settlement handle and chooses a
further bounded observation or eventual join.