Skip to main content

FromHeaderValue

Trait FromHeaderValue 

Source
pub trait FromHeaderValue: Sized {
    // Required methods
    fn from_header_value(value: &str) -> Result<Self, String>;
    fn type_name() -> &'static str;
}
Expand description

Trait for types that can be extracted from header values.

Required Methods§

Source

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

Parse the header value.

Source

fn type_name() -> &'static str

Return the expected type name for error messages.

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.

Implementations on Foreign Types§

Source§

impl FromHeaderValue for bool

Source§

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

Source§

fn type_name() -> &'static str

Source§

impl FromHeaderValue for i32

Source§

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

Source§

fn type_name() -> &'static str

Source§

impl FromHeaderValue for i64

Source§

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

Source§

fn type_name() -> &'static str

Source§

impl FromHeaderValue for u32

Source§

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

Source§

fn type_name() -> &'static str

Source§

impl FromHeaderValue for u64

Source§

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

Source§

fn type_name() -> &'static str

Source§

impl FromHeaderValue for String

Source§

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

Source§

fn type_name() -> &'static str

Implementors§