Module ext

Module ext 

Expand description

Public http1 Extensions

This module provides types and utilities that extend the capabilities of HTTP1 requests and responses in Rama. Extensions are additional pieces of information or features that can be attached to HTTP1 messages via the rama_core::extensions::Extensions map, which is accessible through the methods provided by the rama_core::extensions::ExtensionsRef and rama_core::extensions::ExtensionsMut traits implemented for crate::Request and crate::Response.

§What are extensions?

Extensions allow Rama to associate extra metadata or behaviors with HTTP messages, beyond the standard headers and body. These can be used by advanced users and library authors to access protocol-specific features, track original header casing, handle informational responses, and more.

See for more information the rama book: https://ramaproxy.org/book/intro/state.html#extensions

§How to access extensions

Extensions are stored in the Extensions map of a request or response. You can access them using:

if let Some(ext) = response.extensions().get::<rama_http_types::proto::h1::ext::ReasonPhrase>() {
    // use the extension
}

Modules§

informational
Register callbacks for 1xx HTTP/1 responses on the client.

Structs§

InvalidReasonPhrase
Error indicating an invalid byte when constructing a ReasonPhrase.
ReasonPhrase
A reason phrase in an HTTP/1 response.