Struct libdata::column::RefHeaders []

pub struct RefHeaders<'a>(_);

Just like Headers, but with references instead of owned values.

This allows looking up values when only Option<&Value> is available.

Examples

let val = Value::from(Local("127.0.0.1".parse::<IpAddr>().unwrap()));
let mut headers = Headers::new();
headers.insert(val.clone());

let ref_headers = RefHeaders::from(&headers);
assert_eq!(1, ref_headers.iter().count());

let some_val = Some(val);
let ref_val = some_val.as_ref();
for (ident, vals) in &ref_headers {
    assert_eq!(Ident::of::<Local<IpAddr>>(), *ident);
    assert!(vals.contains(&ref_val));
}

Methods

impl<'a> RefHeaders<'a>
[src]

Iterates through the (Ident, RefHeader) pairs.

Trait Implementations

impl<'a> From<&'a Headers> for RefHeaders<'a>
[src]

Performs the conversion.

impl<'a> IntoIterator for &'a RefHeaders<'a>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more