Skip to main content

CodeGenerator

Trait CodeGenerator 

Source
pub trait CodeGenerator {
    type Output;

    // Required method
    fn generate(&self, ir: &Mir) -> Result<Self::Output>;
}
Expand description

This trait should be implemented on types which handle generating code from AirScript MIR

Required Associated Types§

Source

type Output

The type of the artifact produced by this codegen backend

Required Methods§

Source

fn generate(&self, ir: &Mir) -> Result<Self::Output>

Generates code using this generator, consuming it in the process

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§