pub struct List<'a> { /* private fields */ }Expand description
A validated List.
§Examples
let list = parse_net::sfv::parse_list(b"a, b;x, (c d)")?;
assert_eq!(list.len(), 3);Implementations§
Source§impl<'a> List<'a>
impl<'a> List<'a>
Sourcepub fn iter(&self) -> ListIter<'a> ⓘ
pub fn iter(&self) -> ListIter<'a> ⓘ
The members, in order.
§Examples
use parse_net::sfv::{self, BareItem, Member};
let list = sfv::parse_list(b"a, 2")?;
let mut it = list.iter();
assert!(matches!(it.next(), Some(Member::Item(i)) if i.bare == BareItem::Token("a")));
assert!(matches!(it.next(), Some(Member::Item(i)) if i.bare == BareItem::Integer(2)));
assert!(it.next().is_none());Trait Implementations§
impl<'a> Copy for List<'a>
impl<'a> Eq 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