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