pub trait Tagged {
// Required method
fn get_tag_names(&self) -> &'static [&'static str];
// Provided methods
fn includes_tag_name(&self, tag: &str) -> bool { ... }
fn get_tags<T: Tag>(&self) -> Vec<T> { ... }
fn get_tag<T: Tag>(&self) -> Option<T> { ... }
fn includes_tag<T: Tag + PartialEq>(&self, tag: &T) -> bool { ... }
}Required Methods§
fn get_tag_names(&self) -> &'static [&'static str]
Provided Methods§
fn includes_tag_name(&self, tag: &str) -> bool
Returns all the instances of a tag of type T.
Best used for tags that are not unqiue (such as choice requirements).
Sourcefn get_tag<T: Tag>(&self) -> Option<T>
fn get_tag<T: Tag>(&self) -> Option<T>
Returns the first instance of a tag of type T, if it exists.
Best used for tags that are unique (such as a speaker name).
fn includes_tag<T: Tag + PartialEq>(&self, tag: &T) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".