Expand description
Rust code generation from type-checked Assura contracts.
Takes a TypedFile from assura-types and generates a Rust project
consisting of a Cargo.toml and one or more .rs source files.
Generated Rust is formatted via prettyplease.
This is T019: the initial scaffolding. Type mapping (T020), contract codegen (T021), project generation (T022), and struct/enum codegen (T023) extend this foundation.
Modules§
- features
- Feature-specific code generation for all 50 verification features. Feature-specific Rust code generation for Assura’s 50 verification features.
- hir
- Typed Rust HIR for structured code generation. Typed Rust HIR (High-level Intermediate Representation) for codegen.
- metadata
- Structured contract metadata for AI agent consumption. Structured contract metadata for generated Rust projects.
- type_
map - Assura-to-Rust type mapping (Int -> i64, Nat -> u64, etc.). Reverse type mapping: Rust types to Assura types.
Structs§
- Backend
Config - Configuration for code generation.
- Generated
Project - The result of code generation: a complete Rust project.
Enums§
- Codegen
Backend - Code generation backend.
- Compile
Target - Compilation target for the generated Rust project.
Functions§
- codegen
- Generate a Rust project from a type-checked Assura file.
- codegen_
with_ config - Generate a Rust project from a type-checked Assura file.
- expr_
to_ rust_ static - Convert an Assura
Exprto a Rust expression for use in const context.