vexil-codegen-rust
Rust code generation backend for the Vexil schema compiler.
Takes a CompiledSchema from vexil-lang and emits Rust structs, enums, and Pack/Unpack
trait implementations that serialize to the Vexil wire format.
Usage
Single file
use compile;
use generate;
let result = compile;
let compiled = result.compiled.expect;
let code: String = generate?;
Multi-file project
use compile_project;
use RustBackend;
use CodegenBackend;
let project = compile_project?;
let files: = RustBackend.generate_project?;
// files includes per-schema .rs files and a mod.rs with re-exports
Generated code depends on vexil-runtime for
bit-level I/O and the Pack/Unpack traits.
License
Licensed under either of MIT or Apache-2.0 at your option.