Skip to main content

HeaderSource

Trait HeaderSource 

Source
pub trait HeaderSource {
    // Required method
    fn header_values<'a>(
        &'a self,
        name: &'a str,
    ) -> impl Iterator<Item = &'a [u8]> + 'a;
}
Expand description

Read access to request headers, so the core works without any HTTP library.

Implemented for [(&str, &str)] slices (names compared case-insensitively) and, with the axum feature, for http::HeaderMap.

Required Methods§

Source

fn header_values<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a [u8]> + 'a

All values of the header name (lowercase), in order.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl HeaderSource for HeaderMap

Available on crate feature axum only.
Source§

fn header_values<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a [u8]> + 'a

Source§

impl HeaderSource for Vec<(&str, &str)>

Source§

fn header_values<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a [u8]> + 'a

Source§

impl HeaderSource for [(&str, &str)]

Source§

fn header_values<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a [u8]> + 'a

Source§

impl<const N: usize> HeaderSource for [(&str, &str); N]

Source§

fn header_values<'a>( &'a self, name: &'a str, ) -> impl Iterator<Item = &'a [u8]> + 'a

Implementors§