MetaOnly

Struct MetaOnly 

Source
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

Source

pub fn new() -> Self

Constructs empty MetaOnly container

Source

pub fn iter_typed_tags(&self) -> impl Iterator<Item = &dyn MetaTag>

Returns an Iterator over all strongly typed metadata tags in the container.

Source

pub fn iter_string_kv(&self) -> impl Iterator<Item = (&str, &str)>

Returns an Iterator over all string key-value metadata pairs in the container.

Source

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 Clone for MetaOnly

Source§

fn clone(&self) -> MetaOnly

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MetaOnly

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MetaOnly

Source§

fn default() -> MetaOnly

Returns the “default value” for a type. Read more
Source§

impl MetaContainer for MetaOnly

Source§

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

Returns true if container contains a tag of type T, false otherwise
Source§

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 otherwise
Source§

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>

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>

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

Returns true if this container has typed metadata, false otherwise
Source§

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

Returns true if container contains key key, false otherwise
Source§

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>

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>

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

Returns true if this container has string metadata, false otherwise
Source§

impl PartialEq for MetaOnly

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.