pub struct XmlConfig { /* private fields */ }
Expand description
XmlBuilder configuration options
Implementations§
Source§impl XmlConfig
impl XmlConfig
Sourcepub fn new() -> XmlConfig
pub fn new() -> XmlConfig
Initialze a new XmlConfig instance.
This uses the builder pattern. All options are initialized to None
and can be set using
self
s methods. Any options not set will use their defaults upon call to finalize
.
Sourcepub fn root_name<T: Into<String>>(&mut self, key: T) -> &mut XmlConfig
pub fn root_name<T: Into<String>>(&mut self, key: T) -> &mut XmlConfig
Root key name to contain produced JSON object.
When this is set to its default value “root”, the output will not be wrapped in root_name
’s
value. This is to conform to match the behavior of node-xml2js.
("root"
by default)
Sourcepub fn attrkey<T: Into<String>>(&mut self, key: T) -> &mut XmlConfig
pub fn attrkey<T: Into<String>>(&mut self, key: T) -> &mut XmlConfig
Attribute key
The value of the JSON key used to store XML attributes under.
("$"
by default)
Sourcepub fn charkey<T: Into<String>>(&mut self, key: T) -> &mut XmlConfig
pub fn charkey<T: Into<String>>(&mut self, key: T) -> &mut XmlConfig
Char data key
The value of the JSON key used to store XML character data under.
("_"
by default)
Sourcepub fn decl(&mut self, decl: Declaration) -> &mut XmlConfig
pub fn decl(&mut self, decl: Declaration) -> &mut XmlConfig
XML Declaration
(Declaration::default() by default) Declaration::default(): Declaration::default
Sourcepub fn rendering(&mut self, indentation: Indentation) -> &mut XmlConfig
pub fn rendering(&mut self, indentation: Indentation) -> &mut XmlConfig
Rendering indentation options
(None
by default)
Sourcepub fn finalize(&self) -> XmlBuilder
pub fn finalize(&self) -> XmlBuilder
Finalize configuration options and build an XmlBuilder instance