xsd_parser/models/data/
mod.rs

1//! Rust-oriented data type representations for code generation.
2//!
3//! This module defines the full set of intermediate structures used to represent
4//! resolved and Rust-specific data types, derived from interpreted and optimized
5//! XML schemas meta types.
6//!
7//! These types abstract the XML schema constructs into idiomatic Rust equivalents
8//! like structs, enums, options, and vectors, and form the backbone of the code
9//! generation phase.
10
11mod build_in;
12mod complex;
13mod custom;
14mod dynamic;
15mod enumeration;
16mod occurs;
17mod path_data;
18mod reference;
19mod simple;
20mod tag_name;
21mod type_;
22mod types;
23mod union;
24
25pub use self::build_in::BuildInData;
26pub use self::complex::{
27    ComplexBase, ComplexData, ComplexDataAttribute, ComplexDataContent, ComplexDataElement,
28    ComplexDataElementOrigin, ComplexDataEnum, ComplexDataStruct, StructMode,
29};
30pub use self::custom::CustomData;
31pub use self::dynamic::{DerivedType, DynamicData};
32pub use self::enumeration::{EnumerationData, EnumerationTypeVariant};
33pub use self::occurs::Occurs;
34pub use self::path_data::PathData;
35pub use self::reference::ReferenceData;
36pub use self::simple::SimpleData;
37pub use self::tag_name::TagName;
38pub use self::type_::{DataType, DataTypeVariant};
39pub use self::types::DataTypes;
40pub use self::union::{UnionData, UnionTypeVariant};
41
42/// A generic configuration value wrapper that supports different merging strategies.
43///
44/// This enum is used to represent configuration fields that may either use default values,
45/// extend existing ones, or completely overwrite them. It provides a flexible mechanism
46/// for combining configurations from multiple sources.
47#[derive(Default, Debug)]
48pub enum ConfigValue<T> {
49    /// Uses the default behavior or value.
50    #[default]
51    Default,
52
53    /// Appends or merges the provided value with existing data.
54    Extend(T),
55
56    /// Replaces any existing data with the provided value.
57    Overwrite(T),
58}