pub struct CodegenConfig {
pub strip_prefix: Option<String>,
pub module_name: String,
pub name_mappings: Option<NameMappings>,
pub feature_mappings: Option<FeatureMappings>,
pub warn_unmapped: bool,
pub xml_serialize_prefix: Option<String>,
pub cross_crate_imports: Vec<String>,
pub cross_crate_type_prefix: HashMap<String, (String, String)>,
}Expand description
Code generation configuration.
Fields§
§strip_prefix: Option<String>Namespace prefix to strip from type names (e.g., “w_” for WordprocessingML).
module_name: StringModule name for the generated code (e.g., “sml”, “wml”).
name_mappings: Option<NameMappings>Optional name mappings for nicer Rust names.
feature_mappings: Option<FeatureMappings>Optional feature mappings for conditional compilation.
warn_unmapped: boolWarn about types/fields without mappings (useful for finding unmapped items).
xml_serialize_prefix: Option<String>XML namespace prefix for serialized element/attribute names (e.g., “w” for WML).
None = use unprefixed names (default namespace convention, used by SML/XLSX).
Some(“w”) = use w: prefix (WML/DOCX), Some(“p”) = use p: prefix (PML/PPTX), etc.
cross_crate_imports: Vec<String>Cross-crate imports for parser/serializer generation. Each entry is a full use path (e.g., “ooxml_dml::types::” or “ooxml_dml::parsers::”). Used when types from another crate are referenced in this schema.
cross_crate_type_prefix: HashMap<String, (String, String)>Cross-crate type resolution for the type generator. Maps schema name prefixes (e.g., “a_”) to (crate_path, module_name) tuples. Example: “a_” → (“ooxml_dml::types::”, “dml”) When a reference like “a_CT_Color” is not found locally, it’s resolved using the module’s name mappings (if available) or converted to PascalCase.
Trait Implementations§
Source§impl Clone for CodegenConfig
impl Clone for CodegenConfig
Source§fn clone(&self) -> CodegenConfig
fn clone(&self) -> CodegenConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more