Expand description
The C column’s encoder: crate::emit::encode bound to the C
backend.
The walk moved to emit/encode.rs when it stopped being C’s alone.
What is left here is the binding, and it is a module rather than four
turbofishes at each call site because the C generator asks for these
by name in twenty places and a ::<C> at each is twenty chances to
reach for the wrong backend.
What C forces that the walk does not decide:
- A pointer parameter. A codec takes
const T *vand reaches its members with->. Every target spells that its own way, andcrate::emit::CodecTarget::memberis where. - An array parameter decays. An array codec takes the array
itself, not its address: C adjusts an array parameter to a pointer
to its first element, and
(*v)[i][j]would otherwise need parentheses the tree has no node for. So a call site passesv->gridfor an array and&v->xfor everything else. - Prototypes ahead of bodies, so a recursive or mutually recursive type does not depend on the order the walk visited its types in.
Re-exports§
pub use crate::emit::encode::CodecOptions as CCodecOptions;
Functions§
- c_codec
- Build the C encoder for every type in the model, under one plan.
- c_
codec_ from - The C encoder for the types one root reaches, and no others.
- c_
key_ holder - The C key holder for a keyed type, and nothing for one with no
@key. - codec_
name - The name of the C encoder function for a type.
- maybe_
unused - Whether the C codec generated for
idmay legitimately have no caller. Seeencode::maybe_unused.