#[non_exhaustive]pub enum EnumKind {
Strings(Vec<StringVariant>),
Integers {
repr: RustType,
variants: Vec<IntegerVariant>,
},
Union(Vec<UnionVariant>),
}Expand description
The flavour of a generated enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Strings(Vec<StringVariant>)
A C-like string enum: unit variants mapped to wire strings.
Integers
A C-like integer enum: unit variants with explicit discriminants.
The wire form is a bare number, so the emitted type carries
#[serde(try_from, into)] and a #[repr] of Self::Integers::repr.
Fields
§
variants: Vec<IntegerVariant>The permitted values, in document order.
Union(Vec<UnionVariant>)
A #[serde(untagged)] union over the given newtype variants.
Untagged (rather than internally tagged) is used even when the OpenAPI schema has a discriminator: OpenAPI variant schemas typically carry the discriminator property themselves, which is incompatible with serde’s internally-tagged representation.
Trait Implementations§
impl StructuralPartialEq for EnumKind
Auto Trait Implementations§
impl Freeze for EnumKind
impl RefUnwindSafe for EnumKind
impl Send for EnumKind
impl Sync for EnumKind
impl Unpin for EnumKind
impl UnsafeUnpin for EnumKind
impl UnwindSafe for EnumKind
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