pub enum ComplexType<'types> {
Enum {
type_: ComplexTypeEnum<'types>,
content_type: Option<Box<ComplexType<'types>>>,
},
Struct {
type_: ComplexTypeStruct<'types>,
content_type: Option<Box<ComplexType<'types>>>,
},
}Expand description
Contains additional information for the rendering process
of a TypeVariant::All, TypeVariant::Choice,
TypeVariant::Sequence or TypeVariant::ComplexType type.
To simplify the rendering process this recursive type was added to the generator. It basically boils down to the following:
- A complex type with a
choicewill result in a struct with a enum content type. - A complex type with a
allorsequencewill result in a struct with a struct content type. - A simple
choicewill result in a single enum type. - A simple
allorsequencewill result in a single sequence.
Additional improvements may be applied to the type, to reduce the complexity of the generated type (for example flattening the content if possible).
Variants§
Enum
The type represents an enumeration.
This is normally used for choice elements.
Fields
§
type_: ComplexTypeEnum<'types>The main type.
§
content_type: Option<Box<ComplexType<'types>>>The content of the main type (if needed).
Struct
The type represents a struct.
This is normally used for all
Fields
§
type_: ComplexTypeStruct<'types>The main type.
§
content_type: Option<Box<ComplexType<'types>>>The content of the main type (if needed).
Trait Implementations§
Auto Trait Implementations§
impl<'types> Freeze for ComplexType<'types>
impl<'types> RefUnwindSafe for ComplexType<'types>
impl<'types> !Send for ComplexType<'types>
impl<'types> !Sync for ComplexType<'types>
impl<'types> Unpin for ComplexType<'types>
impl<'types> UnwindSafe for ComplexType<'types>
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