pub struct MetaData<'types> {
pub types: &'types DataTypes<'types>,
pub flags: RendererFlags,
pub derive: Vec<Ident>,
pub dyn_type_traits: Vec<IdentPath>,
pub xsd_parser_crate: Ident,
}
Expand description
Meta data of the render process.
Contains different information and data that is useful during the code rendering process.
Fields§
§types: &'types DataTypes<'types>
Data types generated by the Generator
.
flags: RendererFlags
Flags that controls the behavior of the renderer.
derive: Vec<Ident>
Traits the renderer should derive all types from.
dyn_type_traits: Vec<IdentPath>
List of traits that should be implemented by dynamic types.
xsd_parser_crate: Ident
Name of the xsd_parser
crate.
Implementations§
Source§impl MetaData<'_>
impl MetaData<'_>
Sourcepub fn check_renderer_flags(&self, flags: RendererFlags) -> bool
pub fn check_renderer_flags(&self, flags: RendererFlags) -> bool
Whether the passed flags
intersect with the renderer flags set in
the configuration, or not.
Methods from Deref<Target = GeneratorMetaData<'types>>§
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)
.