pub struct HttpPersistentSettings { /* private fields */ }Expand description
Settings persisted across HTTP/1.x keepalive requests on the same downstream connection.
In addition to framework-managed keepalive parameters, this struct can carry an optional
user-defined context via set_user_context. The proxy layer
populates this through ProxyHttp::persist_connection_context
and delivers it to the next request through ProxyHttp::on_connection_reuse.
Also carries pipelined-prefix bytes when the caller has opted into HTTP/1.1
pipelining on the previous session. See
Self::set_pipelined_prefix and the
HttpSession::set_pipelining_enabled
docs for the RFC 9112 §9.3.2 semantics.
Implementations§
Source§impl HttpPersistentSettings
impl HttpPersistentSettings
pub fn for_session(session: &ServerSession) -> Self
Sourcepub fn set_user_context(&mut self, ctx: Box<dyn Any + Send + Sync>)
pub fn set_user_context(&mut self, ctx: Box<dyn Any + Send + Sync>)
Set a user-defined context to be carried to the next request on this connection.
Sourcepub fn take_user_context(&mut self) -> Option<Box<dyn Any + Send + Sync>>
pub fn take_user_context(&mut self) -> Option<Box<dyn Any + Send + Sync>>
Take the user-defined context, if any.
Sourcepub fn set_pipelined_prefix(&mut self, prefix: BytesMut)
pub fn set_pipelined_prefix(&mut self, prefix: BytesMut)
Set pipelined-prefix bytes to be fed to the next session on this connection. Called by the proxy layer when HTTP/1.1 pipelining is enabled on the current session and overread bytes were present at reuse time.