Enum serde_derive_internals::attr::TagType[][src]

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

Styles of representing an enum.

Variants

External

The default.

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

#[serde(tag = "type")]

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

Fields of Internal

tag: String
Adjacent

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

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

Fields of Adjacent

tag: Stringcontent: String
None

#[serde(untagged)]

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

Auto Trait Implementations

impl RefUnwindSafe for TagType

impl Send for TagType

impl Sync for TagType

impl Unpin for TagType

impl UnwindSafe for TagType

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.