pub struct TagMap<'a> { /* private fields */ }
Expand description
Implementations§
source§impl<'a> TagMap<'a>
impl<'a> TagMap<'a>
sourcepub fn with_keyset(keyset: &'a [TagDesc]) -> Self
pub fn with_keyset(keyset: &'a [TagDesc]) -> Self
Create a new TagMap whose set of keys is determined by
the provided keyset
. This will have one value slot for
each provided key.
sourcepub fn add_checked(&mut self, val: TagValue) -> bool
pub fn add_checked(&mut self, val: TagValue) -> bool
Try to add the next tag value. If there is space and the type
matches, add it and return true
, otherwise return false
.
sourcepub fn add(&mut self, val: TagValue)
pub fn add(&mut self, val: TagValue)
add the next TagValue to the data for this TagMap. This function doesn’t check if the type is correct or if too many tag values have been added. It should only be used when one is certain that the next tag value appropriately matches the next available key.
sourcepub fn get(&self, key: &str) -> Option<&TagValue>
pub fn get(&self, key: &str) -> Option<&TagValue>
get the value for the tag associated with the name key
, returns
Some(&TagValue) for the appropriate tag if it exists, and None otherwise.
sourcepub fn get_at_index(&self, idx: usize) -> Option<&TagValue>
pub fn get_at_index(&self, idx: usize) -> Option<&TagValue>
get the value for the tag at index idx
returns Some(&TagValue) if idx
is in bounds and None otherwise.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for TagMap<'a>
impl<'a> Send for TagMap<'a>
impl<'a> Sync for TagMap<'a>
impl<'a> Unpin for TagMap<'a>
impl<'a> UnwindSafe for TagMap<'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