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)); }