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
axum or http-binding or poem or reqwest 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".
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