Skip to main content

NamedHeader

Trait NamedHeader 

Source
pub trait NamedHeader: Sized + Send {
    const HEADER_NAME: &'static str;

    // Required method
    fn from_value(value: &str) -> Result<Self, String>;
}
Expand description

Trait for types that can be extracted from a named HTTP header.

Required Associated Constants§

Source

const HEADER_NAME: &'static str

The header name (lowercase), e.g. "content-type".

Required Methods§

Source

fn from_value(value: &str) -> Result<Self, String>

Parse the header value string into this type.

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.

Implementors§