Skip to main content

Template

Trait Template 

Source
pub trait Template: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn description(&self) -> &str;
    fn category(&self) -> TemplateCategory;
    fn expand(&self) -> Result<Vec<UnifiedRule>>;

    // Provided methods
    fn tags(&self) -> Vec<&str> { ... }
    fn render(&self, _variables: &HashMap<String, String>) -> Result<String> { ... }
}
Expand description

A loadable template

Required Methods§

Source

fn name(&self) -> &str

Get the template name

Source

fn description(&self) -> &str

Get a description of this template

Source

fn category(&self) -> TemplateCategory

Get the category of this template

Source

fn expand(&self) -> Result<Vec<UnifiedRule>>

Expand this template to rules

Provided Methods§

Source

fn tags(&self) -> Vec<&str>

Get template tags for discovery

Source

fn render(&self, _variables: &HashMap<String, String>) -> Result<String>

Render this template to a string

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§