Skip to main content

Module codegen

Module codegen 

Source
Expand description

Multi-language code generation backends (Rust, C++, Python). Multi-language code generation backends for parsed CSS.

The kernel of a future “compile UI to standalone project” feature exposed by the azul-dll debug HTTP server: a parsed Css is fed to a [CodegenBackend] implementation, which returns a complete source string plus auxiliary files (e.g. Cargo.toml) for a target language.

Today only [rust::RustBackend] is implemented; [cpp] and [python] hold stub backends so the public API stays stable as new languages come online.

Modules§

cpp
C++ backend stub. Returns a single placeholder source file noting that the emitter is not implemented; the dispatch path in super::backend_for is still wired so ?lang=cpp produces a structured response instead of a 404.
python
Python backend stub. Returns a single placeholder source file noting that the emitter is not implemented; the dispatch path in super::backend_for is still wired so ?lang=python produces a structured response instead of a 404.
rust
Rust source-code emitter for parsed CSS.

Structs§

GeneratedFile
One emitted source artifact (e.g. src/main.rs, Cargo.toml).

Traits§

CodegenBackend
Pluggable code-generation strategy. Each backend turns a parsed Css into a list of files that, taken together, form a buildable standalone project.

Functions§

backend_for
Look up a backend by its CodegenBackend::lang identifier.