atproto_codegen/emit/exprs

Per-field expressions: the Gleam type, encoder, and decoder for one lexicon field type, plus the predicates the header/emission logic keys on.

Values

pub fn decoder_expr(
  cfg: config.Config,
  current: String,
  union_name: String,
  ft: lower.FlatType,
) -> String
pub fn encoder_expr(
  cfg: config.Config,
  current: String,
  union_name: String,
  ft: lower.FlatType,
) -> String
pub fn escape(value: String) -> String
pub fn gleam_type(
  cfg: config.Config,
  current: String,
  union_name: String,
  ft: lower.FlatType,
) -> String
pub fn type_uses_blob(ft: lower.FlatType) -> Bool
pub fn type_uses_helper(ft: lower.FlatType) -> Bool

Only an open union pulls in the internal import.

pub fn type_uses_unknown(ft: lower.FlatType) -> Bool

Only an open union needs dynamic (Other variant, nil zero).

pub fn union_type_name(
  cfg: config.Config,
  def: lower.FlatDef,
  prop: lower.FlatField,
) -> String

The synthesized name for a property’s inline union type.

pub fn zero_expr(
  plan: zero.ZeroPlan,
  cfg: config.Config,
  current: String,
  union_name: String,
  ft: lower.FlatType,
) -> String

Zero for one field type; arrays/optionals never recurse.

Search Document