pub struct DataType<'types> {
pub meta: &'types MetaType,
pub derive: ConfigValue<Vec<IdentPath>>,
pub variant: DataTypeVariant<'types>,
pub extra_attributes: Vec<TokenStream>,
}Expand description
Represents a fully evaluated and enriched type definition used for rendering.
A DataType wraps a MetaType and augments it with generator-evaluated
context required by the rendering phase. This avoids duplicating logic in
multiple renderers by providing a preprocessed, render-ready structure.
Each DataType includes both a reference to the original meta type and
a DataTypeVariant which contains the specific generator output based
on the kind of the underlying type.
Fields§
§meta: &'types MetaTypeUnderlying meta type this data type contains additional information for.
derive: ConfigValue<Vec<IdentPath>>Defines traits to derive the type from.
variant: DataTypeVariant<'types>The variant of the data type.
extra_attributes: Vec<TokenStream>Additional attributes that will be added to the type.
Methods from Deref<Target = MetaType>§
Sourcepub fn form(&self) -> FormChoiceType
pub fn form(&self) -> FormChoiceType
Returns the form element of this type should have.
Sourcepub fn is_emptiable(&self, types: &MetaTypes) -> bool
pub fn is_emptiable(&self, types: &MetaTypes) -> bool
Returns true if this type is emptiable, false otherwise.
Emptiable means that the type may not have any element.
Methods from Deref<Target = MetaTypeVariant>§
Sourcepub fn is_emptiable(&self, types: &MetaTypes) -> bool
pub fn is_emptiable(&self, types: &MetaTypes) -> bool
Returns true if this type is emptiable, false otherwise.
Emptiable means that the type may not have any element, but a simple text value.