fn is_unknown_variant_tag<T: DeserializeOwned>(tag: &str) -> boolExpand description
Decides whether tag names a variant unknown to T, without T having
to enumerate its variants.
Two probe payloads ({"tag": null} and {"tag": true}) are re-deserialized
for the same tag:
- If
Taccepts either payload, the tag is recognized (a known variant). - If both are rejected, the tag is unknown iff the two errors are identical.
An unknown variant yields a payload-independent “unknown variant” error for
both probes, whereas a known variant rejects
nullandboolwith different “invalid type” messages.