pub fn source(
ast: &Ast,
language: Language,
key: LayoutKey,
) -> Result<String, GenerateError>Expand description
The declarations of ast and its codec, as source in language: the
encoder crate::emit::encode::codec builds, the Table 9 defaulters
its decoder calls, and the decoder crate::emit::decode::decoder
builds — every one of them, rendered through the same materialiser
and renderer declarations uses.
Every type the model declares, not one root. codec and decoder
already walk and dedupe by name over the whole model — the same two
functions encode_c::c_codec and decode_c::c_decoder bind for the
C column, which crates/security-rtps builds a full binding through.
A single --type root, the shape every wireprobe-zerodds-<lang>-gen
takes, is a probe’s question: it exists so a byte comparison has one
sample to run, and a generated application has no such reason to stop
at the first struct, union or valuetype the model declares.
§Errors
GenerateError: GenerateError::Rules and
GenerateError::NoForm as declarations; GenerateError::Codec
when the layout cannot be planned or a construct has no writer or
reader.