Skip to main content

AsHeaders

Trait AsHeaders 

Source
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§

Source

type Error: Error + Send + Sync + 'static

The error type which can occur when converting the type into headers.

Source

type Iter: Iterator<Item = (HeaderName, HeaderValue)>

The iterator type which yields header name/value pairs.

Required Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl<T> AsHeaders for Option<T>

Source§

fn as_headers(&self) -> Result<Self::Iter, T::Error>

Iterate over all the header name/value pairs.

Source§

type Error = <T as AsHeaders>::Error

Source§

type Iter = <T as AsHeaders>::Iter

Implementors§