pub struct GetAll<'a, VE: ValueEncoding> { /* private fields */ }
Expand description
A view to all values stored in a single entry.
This struct is returned by MetadataMap::get_all
and
MetadataMap::get_all_bin
.
Implementations§
source§impl<'a, VE: ValueEncoding> GetAll<'a, VE>
impl<'a, VE: ValueEncoding> GetAll<'a, VE>
sourcepub fn iter(&self) -> ValueIter<'a, VE> ⓘ
pub fn iter(&self) -> ValueIter<'a, VE> ⓘ
Returns an iterator visiting all values associated with the entry.
Values are iterated in insertion order.
Examples
let mut map = MetadataMap::new();
map.insert("x-host", "hello.world".parse().unwrap());
map.append("x-host", "hello.earth".parse().unwrap());
let values = map.get_all("x-host");
let mut iter = values.iter();
assert_eq!(&"hello.world", iter.next().unwrap());
assert_eq!(&"hello.earth", iter.next().unwrap());
assert!(iter.next().is_none());