Struct libdata::column::Tags
[−]
pub struct Tags(_);
Tags of a single entity.
This represents a set of tags. However, the set contains at most one value of each type. This is well suited for things like the header information about flows, for example.
This data storage is cummulative ‒ it is not possible to remove tags (only to replace them).
Methods
impl Tags
[src]
fn new() -> Self
Creates a new tag storage.
fn insert<V: Into<Value>>(&mut self, value: V) -> Option<Value>
Inserts a value into the set.
If a value of that column type is already present, the old one is replaced and returned.
fn contains(&self, ident: &Ident) -> bool
Checks if a tag of the given type is present.
fn get(&self, ident: &Ident) -> Option<&Value>
Returns the tag value.
This looks up the value of the given type, if any is present.
fn extend(&mut self, other: Self)
Consumes other
and inserts all its content into self
.
If both self
and other
contain value of the same type, the one in self
is
overwritten and other
wins.
Params
other
: The other tag storage to incorporate intoself
.
fn len(&self) -> usize
Returns how many tags there are inside.
fn is_empty(&self) -> bool
Checks if the storage is empty.
fn idents(&self) -> Keys<Ident, Value>
Iterates over the identities in the tags.
Trait Implementations
impl Clone for Tags
[src]
fn clone(&self) -> Tags
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more