xsd_parser/models/data/simple.rs
1use proc_macro2::{Ident as Ident2, TokenStream};
2
3use crate::models::{
4 data::{ConstrainsData, Occurs},
5 meta::SimpleMeta,
6};
7
8use super::PathData;
9
10/// Contains additional information for the rendering process of a
11/// [`MetaTypeVariant::SimpleType`](crate::models::meta::MetaTypeVariant::SimpleType)
12/// type.
13#[derive(Debug)]
14pub struct SimpleData<'types> {
15 /// Reference to the original type information.
16 pub meta: &'types SimpleMeta,
17
18 /// Occurrence of the referenced type within this type.
19 pub occurs: Occurs,
20
21 /// Code generator data for the constrains of the type.
22 pub constrains: ConstrainsData<'types>,
23
24 /// The identifier of the rendered type.
25 pub type_ident: Ident2,
26
27 /// Actual target type of this referenced type.
28 pub target_type: PathData,
29
30 /// List of traits that needs to be implemented by this type.
31 pub trait_impls: Vec<TokenStream>,
32}