Skip to main content

Generator

Trait Generator 

Source
pub trait Generator {
    // Required methods
    fn name(&self) -> &str;
    fn plan(&self, ctx: &GenContext, args: &[String]) -> Result<Plan>;
}
Expand description

A third-party (or built-in) code generator. Implement this to extend gize (ADR-008, v0).

Required Methods§

Source

fn name(&self) -> &str

The subcommand name, e.g. "healthcheck" (invoked as gize healthcheck …).

Source

fn plan(&self, ctx: &GenContext, args: &[String]) -> Result<Plan>

Build a Plan from the project context and the plugin’s arguments. Pure — do no I/O here, so the plan stays testable and --dry-run works.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§