pub struct MetaData<'types> {
pub types: &'types MetaTypes,
pub flags: GeneratorFlags,
pub postfixes: [String; 10],
pub box_flags: BoxFlags,
pub typedef_mode: TypedefMode,
pub text_type: IdentPath,
pub mixed_type: IdentPath,
pub nillable_type: IdentPath,
pub any_type: IdentPath,
pub any_attributes_type: IdentPath,
}Expand description
Meta data of the generator process.
Contains different information and data that is useful during the code generation process.
Fields§
§types: &'types MetaTypesReference to the types the code should be generated for.
flags: GeneratorFlagsFlags that controls the behavior of the generator.
postfixes: [String; 10]List of postfixed to add to the name of the generated types.
This corresponds to the variants of IdentType.
box_flags: BoxFlagsTells the generator how to deal with boxed elements.
typedef_mode: TypedefModeTells the generator how to deal with type definitions.
text_type: IdentPathType to use to store unformatted text.
mixed_type: IdentPathType to use to store mixed types.
nillable_type: IdentPathType to use to store nillable types.
any_type: IdentPathType to use to store unstructured xs:any elements.
any_attributes_type: IdentPathType to use to store unstructured xs:anyAttribute attributes.
Implementations§
Source§impl MetaData<'_>
impl MetaData<'_>
Sourcepub fn check_generator_flags(&self, flags: GeneratorFlags) -> bool
pub fn check_generator_flags(&self, flags: GeneratorFlags) -> bool
Whether the passed flags intersect with the generator flags set in
the configuration, or not.
Methods from Deref<Target = MetaTypes>§
Sourcepub fn name_builder(&self) -> Box<dyn NameBuilderTrait>
pub fn name_builder(&self) -> Box<dyn NameBuilderTrait>
Create a new boxed NameBuilder, that can be used to build type names.
Sourcepub fn get_resolved<'a>(
&'a self,
ident: &'a Ident,
) -> Option<(&'a Ident, &'a MetaType)>
pub fn get_resolved<'a>( &'a self, ident: &'a Ident, ) -> Option<(&'a Ident, &'a MetaType)>
Get the identifier and the type of the passed ident with all single
type references resolved.
Tries to find the type specified by the passed ident and resolve simple
type definitions to the very base type. If the type could not be found None
is returned.
Sourcepub fn get_resolved_type<'a>(&'a self, ident: &'a Ident) -> Option<&'a MetaType>
pub fn get_resolved_type<'a>(&'a self, ident: &'a Ident) -> Option<&'a MetaType>
Get the type of the passed ident with all single type references resolved.
Like get_resolved, but instead of returning the identifier and
the type it will return only the resolved type.
Sourcepub fn get_resolved_ident<'a>(&'a self, ident: &'a Ident) -> Option<&'a Ident>
pub fn get_resolved_ident<'a>(&'a self, ident: &'a Ident) -> Option<&'a Ident>
Get the type ident of the passed ident with all single type references resolved.
Like get_resolved, but instead of returning the identifier and
the type it will return only the identifier of the resolved type.
Sourcepub fn get_variant(&self, ident: &Ident) -> Option<&MetaTypeVariant>
pub fn get_variant(&self, ident: &Ident) -> Option<&MetaTypeVariant>
Return the MetaTypeVariant of corresponding type for the passed identifier.
This is a shorthand for self.get(ident).map(|ty| &type.variant).