pub struct EnumMacroForSerde {
pub name: TypeIdentifier,
pub type_variants: IndexMap<EnumMacroTypeForSerde, EnumMacroVariants>,
}Expand description
Rendered as follows:
ⓘ
gesha_macros::impl_enum!(
impl Serialize,
impl Deserialize,
MixedTypeEnum {
u64: [(_1000, 1000)],
str: [(_2000, "2000"), (_2001, "2001"), (_2002, "2002")],
i64: [(Minus42, -42)],
bool: [(True, true), (False, false)],
null: [(Null, null)],
},
);From the following YAML:
MixedTypeEnum:
enum:
- 1000
- "2000"
- "2001"
- "2002"
- -42
- true
- false
- nullFields§
§name: TypeIdentifier§type_variants: IndexMap<EnumMacroTypeForSerde, EnumMacroVariants>Implementations§
Source§impl EnumMacroForSerde
impl EnumMacroForSerde
pub fn from_variants(name: TypeIdentifier, variants: Vec<EnumVariant>) -> Self
Trait Implementations§
Source§impl Clone for EnumMacroForSerde
impl Clone for EnumMacroForSerde
Source§fn clone(&self) -> EnumMacroForSerde
fn clone(&self) -> EnumMacroForSerde
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnumMacroForSerde
impl Debug for EnumMacroForSerde
Source§impl PartialEq for EnumMacroForSerde
impl PartialEq for EnumMacroForSerde
impl StructuralPartialEq for EnumMacroForSerde
Auto Trait Implementations§
impl Freeze for EnumMacroForSerde
impl RefUnwindSafe for EnumMacroForSerde
impl Send for EnumMacroForSerde
impl Sync for EnumMacroForSerde
impl Unpin for EnumMacroForSerde
impl UnwindSafe for EnumMacroForSerde
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