Expand description
Rust code generator — rule-based (Tier 2) transpilation from AIR to Rust.
The most direct mapping of any target — Bock’s ownership model was designed to map cleanly to Rust:
- Owned values → owned values (direct)
- Immutable borrow →
&T - Mutable borrow →
&mut T - Move → move semantics (direct)
@managed→Rc<T>(single-threaded) /Arc<T>(concurrent)- Records → structs
- Enums → enums (with variants)
- Traits → traits, Impls → impl blocks (nearly 1:1)
- Effects →
&dyn EffectTraitparameters - Pattern matching → native
match - Generics → monomorphized (preserved)
- String interpolation →
format!()macro
Structs§
- RsGenerator
- Rust code generator implementing the
CodeGeneratortrait.