Function headers_for_prefix
pub fn headers_for_prefix<'a>(
header_names: impl Iterator<Item = &'a str>,
key: &'a str,
) -> impl Iterator<Item = (&'a str, &'a str)>Expand description
Returns an iterator over pairs where the first element is the unprefixed header name that
starts with the input key prefix, and the second element is the full header name.
header_names must be normalized (lowercase) names, as HTTP libraries produce them. A name
matches when it starts with key lowercased, so a modeled prefix such as X-Meta- matches
the wire name x-meta-foo.
This is done without allocating a lowercased copy of key, because it runs per prefix-bound
member on every response. A prefix with no uppercase letters is already its own lowercase
form, so a plain byte comparison is the whole answer; only an uppercase prefix pays for
lowercasing each byte as it compares.