Skip to main content

Module ext

Module ext 

Available on crate features http and std only.
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 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_ref::<rama_http_types::proto::h1::ext::ReasonPhrase>() {
    // use the extension
}

Modules§

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

Structs§

CloseDelimitedResponse
Prefer close-delimited framing when encoding an HTTP/1 response.
ConnectionClose
Marks an HTTP/1 message after which the connection cannot be reused.
InvalidReasonPhrase
Error indicating an invalid byte when constructing a ReasonPhrase.
ReasonPhrase
A reason phrase in an HTTP/1 response.

Enums§

OriginalResponseBodyFraming
Original HTTP/1 response framing, recorded by the client decoder before middleware can remove or change the framing headers.
RequestTargetForm
Wire form used for an HTTP/1 request target.