Trait Headers

Source
pub trait Headers<'a> {
    type Iterator: Iterator<Item = (&'a HeaderName, &'a HeaderValue)>;

    // Required methods
    fn get<K: AsHeaderName>(&self, name: K) -> Option<&HeaderValue>;
    fn iter(&'a self) -> Self::Iterator;
}
Available on crate features http-binding or reqwest or axum or poem only.
Expand description

Any http library should be able to use the to_event function with an implementation of this trait.

Required Associated Types§

Required Methods§

Source

fn get<K: AsHeaderName>(&self, name: K) -> Option<&HeaderValue>

Source

fn iter(&'a self) -> Self::Iterator

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> Headers<'a> for HeaderMap<HeaderValue>

Implemention for the HeaderMap used by warp/reqwest

Source§

type Iterator = Iter<'a, HeaderValue>

Source§

fn get<K: AsHeaderName>(&self, name: K) -> Option<&HeaderValue>

Source§

fn iter(&'a self) -> Self::Iterator

Implementors§