pub trait AsHeaders {
type Error: Error + Send + Sync + 'static;
type Iter: Iterator<Item = (HeaderName, HeaderValue)>;
// Required method
fn as_headers(&self) -> Result<Self::Iter, Self::Error>;
}Expand description
A trait for converting a type into request headers.
Required Associated Types§
Sourcetype Error: Error + Send + Sync + 'static
type Error: Error + Send + Sync + 'static
The error type which can occur when converting the type into headers.
Sourcetype Iter: Iterator<Item = (HeaderName, HeaderValue)>
type Iter: Iterator<Item = (HeaderName, HeaderValue)>
The iterator type which yields header name/value pairs.
Required Methods§
Sourcefn as_headers(&self) -> Result<Self::Iter, Self::Error>
fn as_headers(&self) -> Result<Self::Iter, Self::Error>
Iterate over all the header name/value pairs.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".