pub struct IrToRust { /* private fields */ }Expand description
IR to Rust code generator
Implementations§
Source§impl IrToRust
impl IrToRust
pub fn new(config: CodegenConfig) -> Self
Sourcepub fn emit(&self, expr: &IrExpr) -> CodegenResult<String>
pub fn emit(&self, expr: &IrExpr) -> CodegenResult<String>
Emit complete Rust code for an IR expression
pub fn emit_function( &self, name: &str, params: &[(String, IrType)], ret_type: &IrType, body: &IrExpr, ) -> CodegenResult<String>
pub fn emit_struct( &self, name: &str, fields: &[(String, IrType)], ) -> CodegenResult<String>
pub fn emit_match( &self, scrutinee: &IrExpr, arms: &[IrMatchArm], ) -> CodegenResult<String>
Auto Trait Implementations§
impl Freeze for IrToRust
impl RefUnwindSafe for IrToRust
impl Send for IrToRust
impl Sync for IrToRust
impl Unpin for IrToRust
impl UnsafeUnpin for IrToRust
impl UnwindSafe for IrToRust
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more