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 generate_with_templates(
&self,
api: &Api,
out_dir: &Utf8Path,
config: &GeneratorConfig,
_templates: Option<&TemplateEngine>,
) -> Result<()> { ... }
fn output_files(&self, _api: &Api, _out_dir: &Utf8Path) -> Vec<String> { ... }
fn output_files_with_config(
&self,
api: &Api,
out_dir: &Utf8Path,
_config: &GeneratorConfig,
) -> Vec<String> { ... }
}