Expand description
A decoder-agnostic intermediate representation (IR) of Daml types.
The IR is the seam between “decode Daml-LF” (canton-lf) and “emit Rust”
(this crate’s generator). Neither side knows about the other: a decoder
produces this IR, the generator consumes it — so the LF-decoder choice stays
isolated to lowering, the one step that reads the LF AST
(lower_dar).
Structs§
- Choice
- A choice on a
Template. - Crate
- A whole generated crate: every package in a DAR, each as its own Rust module (so cross-module and cross-package references resolve, and names from different modules cannot collide).
- Enum
- An enumeration: named constructors that carry no payload.
- Field
- One field of a record.
- Interface
- A Daml interface: its view type and choices, plus the on-ledger identity a
choice exercised through the interface needs. The marker struct itself is
emitted from the interface’s
DataCons::Interfacedata type; this adds theInterface/Choiceimpls on that marker. - Module
- A module’s worth of generated declarations: its data types, templates, and interfaces.
- Named
Module - A Daml module rendered as a Rust submodule.
- Package
Module - One package rendered as a Rust module (
pub mod <name> { … }), containing a submodule per Daml module. - Record
- A record data type. Template payloads are records too, so this is reused for
both a plain
data … = … withrecord and atemplate … withpayload. - Template
- A template: its payload fields, its choices, and an optional contract key.
- TypeRef
- A reference to a named Daml data type, with any applied type arguments.
- Variant
- A variant (sum) type: named constructors, each optionally carrying a payload.
- Variant
Constructor - One constructor of a
Variant.