Skip to main content

Generator

Trait Generator 

Source
pub trait Generator {
    // Required methods
    fn name(&self) -> &'static str;
    fn generate(&self, api: &Api, out_dir: &Utf8Path) -> Result<()>;

    // Provided methods
    fn generate_with_config(
        &self,
        api: &Api,
        out_dir: &Utf8Path,
        _config: &GeneratorConfig,
    ) -> Result<()> { ... }
    fn output_files(&self, _api: &Api, _out_dir: &Utf8Path) -> Vec<String> { ... }
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn generate(&self, api: &Api, out_dir: &Utf8Path) -> Result<()>

Provided Methods§

Source

fn generate_with_config( &self, api: &Api, out_dir: &Utf8Path, _config: &GeneratorConfig, ) -> Result<()>

Source

fn output_files(&self, _api: &Api, _out_dir: &Utf8Path) -> Vec<String>

Implementors§