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§
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
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
impl<'a> Headers<'a> for HeaderMap<HeaderValue>
Implemention for the HeaderMap used by warp/reqwest