Skip to main content

HttpHeaders

Trait HttpHeaders 

Source
pub trait HttpHeaders {
    type GetHeaderError: Error + Send + Sync + Unpin;

    // Required method
    fn get(&self, header: &str) -> Result<Cow<'_, str>, Self::GetHeaderError>;
}
Expand description

Abstraction over HTTP response headers, providing typed get-by-name access.

Required Associated Types§

Source

type GetHeaderError: Error + Send + Sync + Unpin

The error type for a failed header lookup.

Required Methods§

Source

fn get(&self, header: &str) -> Result<Cow<'_, str>, Self::GetHeaderError>

Get a header value by name.

§Errors

Returns an error if the header cannot be retrieved

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl HttpHeaders for HeaderMap

Implementors§