pub trait MetaTag:
Any
+ Debug
+ Display
+ MetaTagClone
+ Send
+ Sync { }
Expand description
Core trait that must be implemented by all structs representing metadata.
This trait requires implementers to also implement MetaTagClone
, which is
required to enable cloning of Box<dyn MetaTag>
objects. The Display
impl
of the metadata type is used by rustronomy when printing the metadata contents
of a container.
§Methods
Although the MetaTag
trait itself doesn’t contain any methods, there are
a couple methods implemented for dyn MetaTag
. Most of these are copies from
methods implemented in std
for dyn Any
.
Implementations§
Source§impl dyn MetaTag
impl dyn MetaTag
Sourcepub fn downcast<T: Any + Clone>(&self) -> Option<T>
pub fn downcast<T: Any + Clone>(&self) -> Option<T>
Casts &self
to T
by cloning &T
. This requires T
to impl Clone
.
If self
does not have type T
, this method returns None
.
Sourcepub fn downcast_ref<T: Any>(&self) -> Option<&T>
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
Casts &self
to &T
. If self
does not have type T
, this method returns None
.
Sourcepub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
Casts &mut self
to &mut T
. If self
does not have type T
, this method returns None
.