pub trait Type<T: Template>:
Clone
+ Default
+ EnumMessage
+ Eq
+ PartialEq
+ VariantArray {
// Provided methods
fn types() -> &'static [Self] { ... }
fn name(&self) -> &str { ... }
fn default_template(&self) -> Option<T> { ... }
fn description(&self) -> &str { ... }
fn templates(&self) -> Vec<&T> { ... }
fn provides(&self, template: &T) -> bool { ... }
}
Expand description
A trait for defining overarching types of specific template variants.
A Type has many Template variants.
The method default_template
should be implemented unless
no default templates are desired.
Provided Methods§
Sourcefn default_template(&self) -> Option<T>
fn default_template(&self) -> Option<T>
Get the default template of the type.
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the type’s description.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.