pub struct RustCodegen { /* private fields */ }Expand description
Rust code generator.
Translates linear lambda terms into Rust code, preserving linear ownership semantics through Rust’s move semantics.
Implementations§
Source§impl RustCodegen
impl RustCodegen
Sourcepub fn formula_to_type(&self, formula: &Formula) -> String
pub fn formula_to_type(&self, formula: &Formula) -> String
Generate a Rust type from a formula.
Sourcepub fn term_to_code(&mut self, term: &Term) -> String
pub fn term_to_code(&mut self, term: &Term) -> String
Generate Rust code from a term.
Sourcepub fn generate_function(
&mut self,
name: &str,
sequent: &TwoSidedSequent,
term: &Term,
) -> String
pub fn generate_function( &mut self, name: &str, sequent: &TwoSidedSequent, term: &Term, ) -> String
Generate a complete function from a sequent and term.
Sourcepub fn generate_module(
&mut self,
name: &str,
sequent: &TwoSidedSequent,
term: &Term,
) -> String
pub fn generate_module( &mut self, name: &str, sequent: &TwoSidedSequent, term: &Term, ) -> String
Generate a complete module with necessary imports and type definitions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustCodegen
impl RefUnwindSafe for RustCodegen
impl Send for RustCodegen
impl Sync for RustCodegen
impl Unpin for RustCodegen
impl UnsafeUnpin for RustCodegen
impl UnwindSafe for RustCodegen
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