pub struct List<'a> { /* private fields */ }Expand description
A validated list. Iterating it cannot fail.
§Examples
let l = parse_net::list(b"gzip, , br")?;
assert_eq!(l.len(), 2);
assert_eq!(l.iter().collect::<Vec<_>>(), [&b"gzip"[..], b"br"]);Implementations§
Source§impl<'a> List<'a>
impl<'a> List<'a>
Sourcepub fn iter(&self) -> Elements<'a> ⓘ
pub fn iter(&self) -> Elements<'a> ⓘ
The elements, in order, each trimmed of OWS.
§Examples
let l = parse_net::list(b"a, \"b, c\"")?;
let mut it = l.iter();
assert_eq!(it.next(), Some(&b"a"[..]));
assert_eq!(it.next(), Some(&b"\"b, c\""[..]));
assert_eq!(it.next(), None);Trait Implementations§
impl<'a> Copy for List<'a>
impl<'a> Eq for List<'a>
Source§impl<'a> IntoIterator for List<'a>
impl<'a> IntoIterator for List<'a>
impl<'a> StructuralPartialEq for List<'a>
Auto Trait Implementations§
impl<'a> Freeze for List<'a>
impl<'a> RefUnwindSafe for List<'a>
impl<'a> Send for List<'a>
impl<'a> Sync for List<'a>
impl<'a> Unpin for List<'a>
impl<'a> UnsafeUnpin for List<'a>
impl<'a> UnwindSafe for List<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more