CategoryTrait

Trait CategoryTrait 

Source
pub trait CategoryTrait {
    // Required method
    fn name(&self) -> String;
}
Expand description

Describes a category of nodes.

Used by NodeTemplateTrait::node_finder_categories to categorize nodes templates into groups.

If all nodes in a program are known beforehand, it’s usefult to define an enum containing all categories and implement CategoryTrait for it. This will make it impossible to accidentally create a new category by mis-typing an existing one, like in the case of using string types.

Required Methods§

Source

fn name(&self) -> String

Name of the category.

Implementations on Foreign Types§

Source§

impl CategoryTrait for &str

Source§

fn name(&self) -> String

Source§

impl CategoryTrait for ()

Source§

fn name(&self) -> String

Source§

impl CategoryTrait for String

Source§

fn name(&self) -> String

Implementors§