Function rouille::input::parse_priority_header[][src]

pub fn parse_priority_header(input: &str) -> PriorityHeaderIter<'_>

Notable traits for PriorityHeaderIter<'a>

impl<'a> Iterator for PriorityHeaderIter<'a> type Item = (&'a str, f32);

Parses the value of a header that has values with priorities. Suitable for Accept-*, TE, etc.

Example

use rouille::input::parse_priority_header;

let mut iter = parse_priority_header("text/plain, image/png; q=1.5");

assert_eq!(iter.next().unwrap(), ("text/plain", 1.0));
assert_eq!(iter.next().unwrap(), ("image/png", 1.5));
assert_eq!(iter.next(), None);