The result of compiling one %schema{} entry from a .dxns
document (Dextrin.Schema.Compiler.compile/3) — enough to both
validate a decoded value and convert it both directions between
.dxnb's always-positional wire shape and a named field map.
fields is ordered — that order is the canonical position ↔ name
mapping .dxnb's positional struct encoding needs, which is exactly
why a schema's own fields: has to be an @ordered %{...} in the
source document, not a plain map (.dxn's map type makes no
ordering guarantee, but field order here is semantically
load-bearing, not incidental).
Summary
Functions
Reads application_struct's fields (an arbitrary Elixir struct — not
a Dextrin.Struct) out in this schema's own canonical field order —
the same order .dxnb's positional wire encoding needs. A field this
schema declares but application_struct doesn't have is nil, same
as any other absent field; extra struct fields the schema doesn't
know about are simply not included.
Types
Functions
Reads application_struct's fields (an arbitrary Elixir struct — not
a Dextrin.Struct) out in this schema's own canonical field order —
the same order .dxnb's positional wire encoding needs. A field this
schema declares but application_struct doesn't have is nil, same
as any other absent field; extra struct fields the schema doesn't
know about are simply not included.
What lets Dextrin.Text.Printer/Dextrin.Binary.Encoder serialize a
struct registered via Dextrin.Registry.put_struct_module/3 directly
— without a caller needing to hand-build a Dextrin.Struct
themselves first, closing the loop Dextrin.Schema.Validator.materialize/4
already closes on the way in.