http_types/headers/
names.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::collections::hash_map;
use std::iter::Iterator;

use crate::headers::{HeaderName, HeaderValues};

/// Iterator over the headers.
#[derive(Debug)]
pub struct Names<'a> {
    pub(super) inner: hash_map::Keys<'a, HeaderName, HeaderValues>,
}

impl<'a> Iterator for Names<'a> {
    type Item = &'a HeaderName;

    fn next(&mut self) -> Option<Self::Item> {
        self.inner.next()
    }
}