pub enum EnumRepr {
External,
Internal {
tag: String,
},
Adjacent {
tag: String,
content: String,
},
Untagged,
}Expand description
How the enum is represented in JSON (mirrors serde’s options).
Variants§
External
Default: { "VariantName": { ...data } }
Internal
#[serde(tag = "type")] → { "type": "variant_name", ...data }
Adjacent
#[serde(tag = "t", content = "c")] → { "t": "variant_name", "c": ...data }
Untagged
#[serde(untagged)] — no discriminator
Trait Implementations§
impl StructuralPartialEq for EnumRepr
Auto Trait Implementations§
impl Freeze for EnumRepr
impl RefUnwindSafe for EnumRepr
impl Send for EnumRepr
impl Sync for EnumRepr
impl Unpin for EnumRepr
impl UnsafeUnpin for EnumRepr
impl UnwindSafe for EnumRepr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more