Skip to main content

Header

Trait Header 

Source
pub trait Header {
    // Required methods
    fn header_name(&self) -> HeaderName;
    fn header_value(&self) -> HeaderValue;

    // Provided method
    fn apply_header<H: AsMut<Headers>>(&self, headers: H) { ... }
}
Expand description

A trait representing a HeaderName and HeaderValue pair.

Required Methods§

Source

fn header_name(&self) -> HeaderName

Access the header’s name.

Source

fn header_value(&self) -> HeaderValue

Access the header’s value.

Provided Methods§

Source

fn apply_header<H: AsMut<Headers>>(&self, headers: H)

Insert the header name and header value into something that looks like a Headers map.

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, 'b> Header for (&'a str, &'b str)

Source§

impl<'a, T: Header> Header for &'a T

Implementors§