Enum serde_derive_internals::attr::EnumTag [] [src]

pub enum EnumTag {
    External,
    Internal {
        tag: String,
    },
    Adjacent {
        tag: String,
        content: String,
    },
    None,
}

Styles of representing an enum.

Variants

The default.

{"variant1": {"key1": "value1", "key2": "value2"}}

#[serde(tag = "type")]

{"type": "variant1", "key1": "value1", "key2": "value2"}

Fields of Internal

#[serde(tag = "t", content = "c")]

{"t": "variant1", "c": {"key1": "value1", "key2": "value2"}}

Fields of Adjacent

#[serde(untagged)]

{"key1": "value1", "key2": "value2"}

Trait Implementations

impl Debug for EnumTag
[src]

Formats the value using the given formatter.