pub enum EnumRepr {
Flattened,
ExternallyTagged,
}Expand description
How enum variants are represented in the serialized format.
Variants§
Flattened
Variant fields are flattened to the same level as other fields.
Used by formats like KDL, TOML where all fields appear at one level.
Example: {"name": "...", "host": "...", "port": 8080}
ExternallyTagged
Variant name is a key, variant content is nested under it.
Used by JSON with externally-tagged enums.
Example: {"name": "...", "Tcp": {"host": "...", "port": 8080}}
Trait Implementations§
impl Copy for EnumRepr
impl Eq for EnumRepr
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 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