pub trait FromHeaderValue<'de>: Sized {
// Required method
fn parse_header_value(slice: &'de str) -> Option<Self>;
}Expand description
The FromHeaderValue trait provides a mechanism for parsing individual
HTTP header values from string slices.
Implementers of this trait can convert a raw string representation of an HTTP header value into a more strongly typed representation. This trait abstracts the parsing logic for specific header value types.
This trait is similar in spirit to the standard library’s FromStr trait,
but specifically tailored for HTTP header values and capable of supporting
zero-copy parsing.
Required Methods§
Sourcefn parse_header_value(slice: &'de str) -> Option<Self>
fn parse_header_value(slice: &'de str) -> Option<Self>
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.