Struct quickxml_to_serde::Config[][src]

pub struct Config {
    pub leading_zero_as_string: bool,
    pub xml_attr_prefix: String,
    pub xml_text_node_prop_name: String,
    pub empty_element_handling: NullValue,
}
Expand description

Tells the converter how to perform certain conversions. See docs for individual fields for more info.

Fields

leading_zero_as_string: bool

Numeric values starting with 0 will be treated as strings. E.g. convert <agent>007</agent> into "agent":"007" or "agent":7 Defaults to false.

xml_attr_prefix: String

Prefix XML attribute names with this value to distinguish them from XML elements. E.g. set it to @ for <x a="Hello!" /> to become {"x": {"@a":"Hello!"}} or set it to a blank string for {"x": {"a":"Hello!"}} Defaults to @.

xml_text_node_prop_name: String

A property name for XML text nodes. E.g. set it to text for <x a="Hello!">Goodbye!</x> to become {"x": {"@a":"Hello!", "text":"Goodbye!"}} XML nodes with text only and no attributes or no child elements are converted into JSON properties with the name of the element. E.g. Goodbye!becomes{“x”:“Goodbye!”}Defaults to#text`

empty_element_handling: NullValue

Defines how empty elements like <x /> should be handled.

Implementations

Numbers with leading zero will be treated as numbers. Prefix XML Attribute names with @ Name XML text nodes #text for XML Elements with other children

Create a Config object with non-default values. See the Config struct docs for more info.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.