Rendering boundary for structural RustQ AST and explicit Rust fragments.
Build generated Rust with RustQ.Rust.AST.Builder, ItemBuilder,
PatternBuilder, and TypeBuilder. Keep those values structural until they
are passed to a RustQ template or explicitly rendered here.
Use fragment/2 only for small Rust syntax escapes that RustQ cannot yet
represent as AST.
Summary
Functions
Builds an explicit Rust source fragment for a known splice context.
Renders one Rust AST item, struct field, or explicit fragment.
Renders a list of Rust items separated by blank lines.
Renders a structural Rust type.
Types
@type renderable() :: RustQ.Rust.AST.item() | RustQ.Rust.AST.stmt() | RustQ.Rust.AST.expr() | RustQ.Rust.AST.pat() | RustQ.Rust.AST.type() | RustQ.Rust.AST.StructField.t() | RustQ.Rust.AST.Arm.t() | RustQ.Rust.Fragment.t() | iodata()
Functions
@spec fragment(RustQ.Rust.Fragment.kind(), iodata()) :: RustQ.Rust.Fragment.t()
Builds an explicit Rust source fragment for a known splice context.
@spec render(renderable()) :: String.t()
Renders one Rust AST item, struct field, or explicit fragment.
@spec render_all([RustQ.Rust.AST.item() | RustQ.Rust.Fragment.t()]) :: String.t()
Renders a list of Rust items separated by blank lines.
Renders a structural Rust type.