Skip to main content

Template

Trait Template 

Source
pub trait Template: TemplateMetadata + TryFrom<TemplateInstance> {
    // Required methods
    fn template_definition() -> TemplateDefinition;
    fn template_instance(&self) -> TemplateInstance;
}
Expand description

Trait used to represent a Template

It is strongly recommended to use the srad_macros::Template derive macro instead of implementing this trait manually

Required Methods§

Source

fn template_definition() -> TemplateDefinition

Returns the template definition

Source

fn template_instance(&self) -> TemplateInstance

Creates a template instance from the current state

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§