pub trait RustCodeGen {
// Required method
fn to_rust_tokens(
&self,
ctx: &mut CodeGenContext<'_>,
) -> Result<TokenStream>;
}Expand description
Trait for converting HIR elements to Rust tokens
This is the main trait for code generation. All HIR types that can be converted to Rust code implement this trait.
Required Methods§
fn to_rust_tokens(&self, ctx: &mut CodeGenContext<'_>) -> Result<TokenStream>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".