Type

Trait Type 

Source
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§

Source

fn types() -> &'static [Self]

Get the list of types supported.

Source

fn name(&self) -> &str

Get types’s name.

Source

fn default_template(&self) -> Option<T>

Get the default template of the type.

Source

fn description(&self) -> &str

Get the type’s description.

Source

fn templates(&self) -> Vec<&T>

Get the list of templates of the type.

Source

fn provides(&self, template: &T) -> bool

Check the type provides the template.

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.

Implementors§