pub trait Name {
// Required method
fn name(&self) -> &str;
}Expand description
A named type.
A type can implement this trait to provide a name, possibly defined internally in the type. For example:
use monstermaker_core::Name;
struct Foo {
name: &'static str,
}
impl Name for Foo {
fn name(&self) -> &str {
self.name
}
}