Skip to main content

Tagged

Trait Tagged 

Source
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 { ... }
}
Expand description

Both Line and Choice can be tagged.

Required Methods§

Source

fn get_tag_names(&self) -> &'static [&'static str]

Provided Methods§

Source

fn includes_tag_name(&self, tag: &str) -> bool

Source

fn get_tags<T: Tag>(&self) -> Vec<T>

Returns all the instances of a tag of type T. Best used for tags that are not unqiue (such as choice requirements).

Source

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).

Source

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".

Implementors§