From fa688431b47c82908b8ac58a3bb398ee55989a66 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Wed, 6 Sep 2023 14:43:40 -0700 Subject: [PATCH] document enum variant #[serde(untagged)] --- _src/variant-attrs.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_src/variant-attrs.md b/_src/variant-attrs.md index 42760d96..470f3318 100644 --- a/_src/variant-attrs.md +++ b/_src/variant-attrs.md @@ -98,3 +98,11 @@ containing variants `A`, `B`, and `Unknown` marked `serde(other)`, the `Unknown` variant would be deserialized any time the `"variant"` field of the input is neither `"A"` nor `"B"`. + +- ##### `#[serde(untagged)]` {#untagged} + + Irrespective of the [enum representation](enum-representations.md), serialize + and deserialize this variant as untagged, i.e. simply as the variant's data + with no record of the variant name. + + Untagged variants must be ordered last in the enum definition. \ No newline at end of file