pub enum Tagged {
Externally,
Internally {
tag: String,
},
Adjacently {
tag: String,
content: String,
},
Untagged,
}Expand description
Serde tagging model for enums.
Variants§
Externally
Default: { "VariantName": data }
Internally
#[serde(tag = "type")]: { "type": "VariantName", ...data }
Adjacently
#[serde(tag = "t", content = "c")]: { "t": "VariantName", "c": data }
Untagged
#[serde(untagged)]: just data
Trait Implementations§
impl Eq for Tagged
impl StructuralPartialEq for Tagged
Auto Trait Implementations§
impl Freeze for Tagged
impl RefUnwindSafe for Tagged
impl Send for Tagged
impl Sync for Tagged
impl Unpin for Tagged
impl UnsafeUnpin for Tagged
impl UnwindSafe for Tagged
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