xsd_parser/pipeline/renderer/
meta.rs1use std::ops::Deref;
2
3use proc_macro2::Ident as Ident2;
4
5use crate::config::RendererFlags;
6use crate::models::{code::IdentPath, data::DataTypes};
7
8#[derive(Debug)]
13pub struct MetaData<'types> {
14 pub types: &'types DataTypes<'types>,
16
17 pub flags: RendererFlags,
19
20 pub derive: Vec<IdentPath>,
22
23 pub dyn_type_traits: Vec<IdentPath>,
25
26 pub alloc_crate: Ident2,
28
29 pub xsd_parser_types: Ident2,
31}
32
33impl MetaData<'_> {
34 #[must_use]
37 pub fn check_renderer_flags(&self, flags: RendererFlags) -> bool {
38 self.flags.intersects(flags)
39 }
40}
41
42impl<'types> Deref for MetaData<'types> {
43 type Target = DataTypes<'types>;
44
45 fn deref(&self) -> &Self::Target {
46 self.types
47 }
48}