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