pub enum ComplexData<'types> {
Enum {
type_: ComplexDataEnum<'types>,
content_type: Option<Box<ComplexData<'types>>>,
},
Struct {
type_: ComplexDataStruct<'types>,
content_type: Option<Box<ComplexData<'types>>>,
},
}
Expand description
Contains additional information for the rendering process of a
MetaTypeVariant::All
,
MetaTypeVariant::Choice
,
MetaTypeVariant::Sequence
or MetaTypeVariant::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
choice
will result in a struct with a enum content type. - A complex type with a
all
orsequence
will result in a struct with a struct content type. - A simple
choice
will result in a single enum type. - A simple
all
orsequence
will 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_: ComplexDataEnum<'types>
The main type.
§
content_type: Option<Box<ComplexData<'types>>>
The content of the main type (if needed).
Struct
The type represents a struct.
This is normally used for all
Fields
§
type_: ComplexDataStruct<'types>
The main type.
§
content_type: Option<Box<ComplexData<'types>>>
The content of the main type (if needed).
Trait Implementations§
Auto Trait Implementations§
impl<'types> Freeze for ComplexData<'types>
impl<'types> RefUnwindSafe for ComplexData<'types>
impl<'types> !Send for ComplexData<'types>
impl<'types> !Sync for ComplexData<'types>
impl<'types> Unpin for ComplexData<'types>
impl<'types> UnwindSafe for ComplexData<'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