pub struct ServerHttpSession { /* private fields */ }Expand description
A server-owned session opened through ServerHttpEndpoint.
Call ServerHttpSession::close before dropping a session that admitted
modern request work. Async close is the only API that joins those tasks;
Drop can cancel their exact authorities but cannot synchronously drive an
asupersync runtime to quiescence.
Implementations§
Source§impl ServerHttpSession
impl ServerHttpSession
Sourcepub fn legacy_session_id(&self) -> &str
pub fn legacy_session_id(&self) -> &str
Returns the exact opaque session value required by the legacy POST URI.
Sourcepub fn handle(
&mut self,
cx: &Cx,
request: HttpRequest,
) -> Result<ServerHttpEndpointResponse, ServerHttpEndpointError>
pub fn handle( &mut self, cx: &Cx, request: HttpRequest, ) -> Result<ServerHttpEndpointResponse, ServerHttpEndpointError>
Routes and dispatches one modern or exact-2024 HTTP request.
Sourcepub async fn handle_async(
&mut self,
cx: &Cx,
request: HttpRequest,
) -> Result<ServerHttpEndpointResponse, ServerHttpEndpointError>
pub async fn handle_async( &mut self, cx: &Cx, request: HttpRequest, ) -> Result<ServerHttpEndpointResponse, ServerHttpEndpointError>
Routes one HTTP request on the caller’s Cx instead of block_on.
Sourcepub fn legacy_roots_provider(&self) -> Option<TransportRootsProvider>
pub fn legacy_roots_provider(&self) -> Option<TransportRootsProvider>
Returns a transport-backed roots provider after exact-2024 roots capability negotiation has completed for this HTTP connection.
Sourcepub fn notify_legacy_resource_updated(&mut self, uri: &str) -> bool
pub fn notify_legacy_resource_updated(&mut self, uri: &str) -> bool
Delivers an exact notifications/resources/updated message to this
live legacy HTTP connection when it subscribed to uri.
Returns false without emitting a message when the connection has not
subscribed to the URI, has not completed legacy initialization, or its
SSE stream is not live.