atproto_codegen/emit/def

Emission for one record/object def: its type, _fields helper (object entries without $type, composable by union encoders), encoder, decoder, and (only for defs reachable as a closed union’s fallback member) a mechanical _zero() helper.

Values

pub fn emit_decoder(
  cfg: config.Config,
  nsid: String,
  def: lower.FlatDef,
  name: String,
  props: List(lower.FlatField),
) -> String
pub fn emit_encoder(
  nsid: String,
  name: String,
  is_record: Bool,
) -> String
pub fn emit_fields(
  cfg: config.Config,
  nsid: String,
  def: lower.FlatDef,
  name: String,
  props: List(lower.FlatField),
) -> String

The def’s JSON entries without $type, so callers (the plain encoder, and union encoders that inject a discriminator) compose the final object.

pub fn emit_type(
  cfg: config.Config,
  nsid: String,
  def: lower.FlatDef,
  name: String,
  props: List(lower.FlatField),
) -> String
pub fn emit_zero(
  plan: zero.ZeroPlan,
  cfg: config.Config,
  nsid: String,
  def: lower.FlatDef,
  name: String,
  props: List(lower.FlatField),
) -> String

The def’s <name>_zero() helper; emitted only for fallback members.

Search Document