Function parse_from_header

Source
pub fn parse_from_header<T, K>(
    map: &HeaderMap,
    key: K,
) -> Result<T, DeserializeError>
where T: FromStr<Err = ParseIntError>, K: AsHeaderName,
Expand description

Helper function to parse a header value to an integer.

ยงErrors

Returns a DeserializeError if the header is missing, if the header value is not a valid string, or if the string value cannot be parsed to an integer.