Struct GetAll

pub struct GetAll<'a, T> { /* private fields */ }

A view to all values stored in a single entry.

This struct is returned by HeaderMap::get_all.

Implementations

impl<'a, T: 'a> GetAll<'a, T>

fn iter(&self) -> ValueIter<'a, T>

Returns an iterator visiting all values associated with the entry.

Values are iterated in insertion order.

Examples

# use http::HeaderMap;
# use http::header::HOST;
let mut map = HeaderMap::new();
map.insert(HOST, "hello.world".parse().unwrap());
map.append(HOST, "hello.earth".parse().unwrap());

let values = map.get_all("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());

Trait Implementations

impl<'a, T> IntoIterator for GetAll<'a, T>

type Item = &'a T;
type IntoIter = ValueIter<'a, T>;
fn into_iter(self) -> ValueIter<'a, T>

impl<'a, T: Debug> Debug for GetAll<'a, T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<'a, T: PartialEq> PartialEq for GetAll<'a, T>

fn eq(&self, other: &Self) -> bool

Auto Trait Implementations

impl<'a, T> Freeze for GetAll<'a, T> where &'a HeaderMap<T>: Freeze,

impl<'a, T> RefUnwindSafe for GetAll<'a, T> where &'a HeaderMap<T>: RefUnwindSafe,

impl<'a, T> Send for GetAll<'a, T> where &'a HeaderMap<T>: Send,

impl<'a, T> Sync for GetAll<'a, T> where &'a HeaderMap<T>: Sync,

impl<'a, T> Unpin for GetAll<'a, T> where &'a HeaderMap<T>: Unpin,

impl<'a, T> UnsafeUnpin for GetAll<'a, T> where &'a HeaderMap<T>: UnsafeUnpin,

impl<'a, T> UnwindSafe for GetAll<'a, T> where &'a HeaderMap<T>: UnwindSafe,

Blanket Implementations

impl<T> Any for GetAll<'a, T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for GetAll<'a, T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for GetAll<'a, T> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for GetAll<'a, T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for GetAll<'a, T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for GetAll<'a, T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for GetAll<'a, T> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>