xml_disassembler/
types.rs1use serde_json::Value as JsonValue;
8
9pub type XmlElement = JsonValue;
12
13#[derive(Debug, Clone)]
15pub struct XmlElementParams<'a> {
16 pub element: XmlElement,
17 pub disassembled_path: &'a str,
18 pub unique_id_elements: Option<&'a str>,
19 pub root_element_name: &'a str,
20 pub root_attributes: XmlElement,
21 pub key: &'a str,
22 pub leaf_content: XmlElement,
23 pub leaf_count: usize,
24 pub has_nested_elements: bool,
25 pub format: &'a str,
26 pub xml_declaration: Option<XmlElement>,
27 pub strategy: &'a str,
28}
29
30#[derive(Debug, Clone)]
32pub struct BuildDisassembledFileOptions<'a> {
33 pub content: XmlElement,
34 pub disassembled_path: &'a str,
35 pub output_file_name: Option<&'a str>,
36 pub subdirectory: Option<&'a str>,
37 pub wrap_key: Option<&'a str>,
38 pub is_grouped_array: bool,
39 pub root_element_name: &'a str,
40 pub root_attributes: XmlElement,
41 pub format: &'a str,
42 pub xml_declaration: Option<XmlElement>,
43 pub unique_id_elements: Option<&'a str>,
44}
45
46#[derive(Debug, Clone, Default)]
48pub struct UnifiedParseResult {
49 pub leaf_content: XmlElement,
50 pub leaf_count: usize,
51 pub has_nested_elements: bool,
52 pub nested_groups: Option<XmlElementArrayMap>,
53}
54
55pub type XmlElementArrayMap = std::collections::HashMap<String, Vec<XmlElement>>;
57
58#[derive(Debug, Clone)]
60pub struct BuildDisassembledFilesOptions<'a> {
61 pub file_path: &'a str,
62 pub disassembled_path: &'a str,
63 pub base_name: &'a str,
64 pub post_purge: bool,
65 pub format: &'a str,
66 pub unique_id_elements: Option<&'a str>,
67 pub strategy: &'a str,
68}
69
70#[derive(Debug, Clone)]
72pub struct LeafWriteParams<'a> {
73 pub leaf_count: usize,
74 pub leaf_content: XmlElement,
75 pub strategy: &'a str,
76 pub key_order: Vec<String>,
77 pub options: LeafWriteOptions<'a>,
78}
79
80#[derive(Debug, Clone)]
81pub struct LeafWriteOptions<'a> {
82 pub disassembled_path: &'a str,
83 pub output_file_name: &'a str,
84 pub root_element_name: &'a str,
85 pub root_attributes: XmlElement,
86 pub xml_declaration: Option<XmlElement>,
87 pub format: &'a str,
88}