Expand description
What a client may send, resolved once: the Command union as a decoder.
§3.5: “the client’s entire write surface is send(cmd) into a typed Command union. There is
no other mutation path — mass assignment and over-posting have no representation.” That
property is enforced here, and here only: a field the union does not declare is not decoded, it
is rejected.
§Why this is a schema rather than a lookup
The decoder used to read the program’s type table on every command, which is fine when the
decoder and the type table are in the same process. Mode B’s client has neither — it holds a
bundle, not a program (crate::bundle) — and the one thing worse than a client that cannot
decode a command is a second decoder written to a second reading of the same union. So the
union is resolved to this at compile time, both tiers decode with the same function, and
“the client and the server disagree about what Toggle is” stops being expressible.
Structs§
Enums§
- FieldTy
- A field’s type, resolved through however many newtypes wrap it.