pub struct Item<'a> {
pub bare: BareItem<'a>,
pub params: SfParams<'a>,
}Expand description
An item: a bare item and its parameters.
§Examples
use parse_net::sfv::{self, BareItem};
let item = sfv::parse_item(b"abc;v=2")?;
assert_eq!(item.bare, BareItem::Token("abc"));
assert_eq!(item.params.get("v"), Some(BareItem::Integer(2)));Fields§
§bare: BareItem<'a>The bare item.
params: SfParams<'a>Its parameters.
Implementations§
Source§impl<'a> Item<'a>
impl<'a> Item<'a>
Sourcepub const fn new(bare: BareItem<'a>) -> Self
pub const fn new(bare: BareItem<'a>) -> Self
An item with no parameters (for filling the slots of
Dictionary::index_into).
§Examples
use parse_net::sfv::{BareItem, Item};
let item = Item::new(BareItem::Integer(7));
assert_eq!(item.bare, BareItem::Integer(7));
assert!(item.params.is_empty());Trait Implementations§
impl<'a> Copy for Item<'a>
impl<'a> Eq for Item<'a>
impl<'a> StructuralPartialEq for Item<'a>
Auto Trait Implementations§
impl<'a> Freeze for Item<'a>
impl<'a> RefUnwindSafe for Item<'a>
impl<'a> Send for Item<'a>
impl<'a> Sync for Item<'a>
impl<'a> Unpin for Item<'a>
impl<'a> UnsafeUnpin for Item<'a>
impl<'a> UnwindSafe for Item<'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