Skip to main content

CodeGen

Trait CodeGen 

Source
pub trait CodeGen {
    // Required method
    fn emit(&self, block: &Block) -> Result<String, CodeGenError>;
}
Expand description

A code-generation backend that can emit a Block to a String.

Required Methods§

Source

fn emit(&self, block: &Block) -> Result<String, CodeGenError>

Emit the entire block and return the formatted Lua source.

§Errors

Returns CodeGenError if the AST contains a node that cannot be represented in the target Lua version.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§