pub enum TypeDef {
Struct {
name: String,
description: Option<String>,
fields: Vec<Field>,
},
Enum {
name: String,
description: Option<String>,
variants: Vec<EnumVariant>,
},
Alias {
name: String,
target: String,
},
}Expand description
A user-defined type that becomes a Rust struct/enum/alias.
Variants§
Struct
Plain object → Rust struct.
Fields
Enum
Closed string enum → Rust enum.
Fields
§
variants: Vec<EnumVariant>Variants — each one tracks its Rust name plus an optional original spec name for serde renaming.
Alias
Simple alias → pub type Alias = Target;.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeDef
impl<'de> Deserialize<'de> for TypeDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TypeDef
impl RefUnwindSafe for TypeDef
impl Send for TypeDef
impl Sync for TypeDef
impl Unpin for TypeDef
impl UnsafeUnpin for TypeDef
impl UnwindSafe for TypeDef
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