#[non_exhaustive]pub enum ToolReceiptBody {
Cron(CronReceipt),
CodeMode(CodeModeReceipt),
Unknown {
family: String,
details: Option<Map<String, Value>>,
},
}Expand description
The family-selected body of a receipt: the family discriminator and the
one details object whose shape that discriminator chooses.
Adjacently tagged in spirit — tag = "family", content = "details" — but
written by hand rather than derived, for one reason: serde’s
#[serde(other)] fallback admits only a unit variant, which would
discard both the unrecognized family word and its details. the governing
rules openness requires the opposite: an unknown value is preserved verbatim
so a client falls back only for the part it does not recognize. The
Unknown arm therefore keeps both.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Cron(CronReceipt)
family: "cron".
CodeMode(CodeModeReceipt)
family: "codeMode".
Unknown
A family minted by a newer decision than this build knows. Both the
word and its details are kept exactly as served; nothing about the
payload is assumed, because only the owning family’s decision defines
it.
Never construct this with a registered word. A producer serving cron
builds Self::Cron; Unknown { family: "cron",.. } encodes to the
same wire bytes but does not survive a round-trip — decoding selects
the typed arm, so a payload outside CronReceipt’s members is silently
dropped. The arm exists only to carry words from newer builds, and
decoding never produces it for a word this build knows.
Fields
details: Option<Map<String, Value>>Whatever that family put under details, if anything. A family
with no fields omits the key.
A Map, not a Value: the schema’s open arm types details as
an object, so accepting [1] or null here would let this type
re-encode a frame the published bundle calls invalid. A
non-object fails at decode instead.