pub struct MetaData<'types> {
pub types: &'types MetaTypes,
pub flags: GeneratorFlags,
pub postfixes: [String; 8],
pub box_flags: BoxFlags,
pub typedef_mode: TypedefMode,
pub any_type: Option<IdentPath>,
pub any_attribute_type: Option<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 MetaTypes
Reference to the types the code should be generated for.
flags: GeneratorFlags
Flags that controls the behavior of the generator.
postfixes: [String; 8]
List of postfixed to add to the name of the generated types.
This corresponds to the variants of IdentType
.
box_flags: BoxFlags
Tells the generator how to deal with boxed elements.
typedef_mode: TypedefMode
Tells the generator how to deal with type definitions.
any_type: Option<IdentPath>
Type to use to store unstructured xs:any
elements.
any_attribute_type: Option<IdentPath>
Type 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 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)
.