Trait HeaderEncode
pub trait HeaderEncode: TypedHeader {
// Required method
fn encode<E>(&self, values: &mut E)
where E: Extend<HeaderValue>;
// Provided method
fn encode_to_value(&self) -> HeaderValue { ... }
}
Expand description
A typed header which can be encoded into one or multiple headers.
Required Methods§
fn encode<E>(&self, values: &mut E)where
E: Extend<HeaderValue>,
fn encode<E>(&self, values: &mut E)where
E: Extend<HeaderValue>,
Encode this type to a HeaderValue
, and add it to a container
which has HeaderValue
type as each element.
This function should be infallible. Any errors converting to a
HeaderValue
should have been caught when parsing or constructing
this value.
Provided Methods§
fn encode_to_value(&self) -> HeaderValue
fn encode_to_value(&self) -> HeaderValue
Encode this header to HeaderValue
.
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.