pub struct MetaOnly { /* private fields */ }
Expand description
Basic hashmap based metadata container, containing only metadata.
§Utility traits
MetaOnly
implements Clone
, Debug
, Default
, Display
, Send
and Sync
Implementations§
Source§impl MetaOnly
impl MetaOnly
Returns an Iterator
over all strongly typed metadata tags in the container.
Sourcepub fn iter_string_kv(&self) -> impl Iterator<Item = (&str, &str)>
pub fn iter_string_kv(&self) -> impl Iterator<Item = (&str, &str)>
Returns an Iterator
over all string key-value metadata pairs in the container.
Sourcepub fn iter_string_fmt(&self) -> impl Iterator<Item = String> + '_
pub fn iter_string_fmt(&self) -> impl Iterator<Item = String> + '_
Returns an Iterator
of nicely formatted string key-value metadata pairs in the container.
The format looks like [Key]: "Value"
Trait Implementations§
Source§impl MetaContainer for MetaOnly
impl MetaContainer for MetaOnly
Source§fn insert_tag<T: MetaTag + Clone>(&mut self, tag: &T) -> Option<T>
fn insert_tag<T: MetaTag + Clone>(&mut self, tag: &T) -> Option<T>
Inserts strongly typed tag with type
T
into the container. If the
container already had this type of metadata, its previous value will be
returned.Source§fn contains_tag<T: MetaTag + Clone>(&self) -> bool
fn contains_tag<T: MetaTag + Clone>(&self) -> bool
Returns
true
if container contains a tag of type T
, false
otherwiseSource§fn contains_type_id(&self, type_id: &TypeId) -> bool
fn contains_type_id(&self, type_id: &TypeId) -> bool
Returns
true
if container contains a tag with a type that matches the
provided TypeId
, false
otherwiseSource§fn get_tag<T: MetaTag + Clone>(&self) -> Option<&T>
fn get_tag<T: MetaTag + Clone>(&self) -> Option<&T>
Returns a reference to the strongly typed tag of type
T
, if it exists.Source§fn get_tag_mut<T: MetaTag + Clone>(&mut self) -> Option<&mut T>
fn get_tag_mut<T: MetaTag + Clone>(&mut self) -> Option<&mut T>
Returns a mutable reference to the strongly typed tag of type
T
, if it exists.Source§fn remove_tag<T: MetaTag + Clone>(&mut self) -> Option<T>
fn remove_tag<T: MetaTag + Clone>(&mut self) -> Option<T>
Removes the strongly typed tag with type
T
from the container if it
is present. Returns the value of the removed entry.Source§fn has_typed_metadata(&self) -> bool
fn has_typed_metadata(&self) -> bool
Returns
true
if this container has typed metadata, false
otherwiseSource§fn insert_string_tag(&mut self, key: &str, value: &str) -> Option<String>
fn insert_string_tag(&mut self, key: &str, value: &str) -> Option<String>
Insert string tag with key
key
into the container. If the container already
contained an entry with this key, its previous value will be returned.Source§fn contains_string_tag(&self, key: &str) -> bool
fn contains_string_tag(&self, key: &str) -> bool
Returns
true
if container contains key key
, false
otherwiseSource§fn get_string_tag(&self, key: &str) -> Option<&str>
fn get_string_tag(&self, key: &str) -> Option<&str>
Returns a
&str
reference to the string tag with key key
, if it exists.Source§fn get_string_tag_mut(&mut self, key: &str) -> Option<&mut String>
fn get_string_tag_mut(&mut self, key: &str) -> Option<&mut String>
Returns a
&mut String
mutable reference to the string tag with key key
,
if it exists.Source§fn remove_string_tag(&mut self, key: &str) -> Option<String>
fn remove_string_tag(&mut self, key: &str) -> Option<String>
Removes tag with key
key
from the container, if it is present. Returns
the value of the removed entry.Source§fn has_string_metadata(&self) -> bool
fn has_string_metadata(&self) -> bool
Returns
true
if this container has string metadata, false
otherwiseAuto Trait Implementations§
impl Freeze for MetaOnly
impl !RefUnwindSafe for MetaOnly
impl Send for MetaOnly
impl Sync for MetaOnly
impl Unpin for MetaOnly
impl !UnwindSafe for MetaOnly
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