pub struct JsonConfig { /* private fields */ }
Expand description

Configuration options for JsonBuilder

Implementations

JsonBuilder configuration options

Initialze a new JsonConfig instance.

This uses the builder pattern. All options are initialized to None and can be set using selfs methods. Any options not set will use their defaults upon call to finalize.

Key to store character content under.

("_" by default)

Key to outer object containing tag attributes.

("$" by default)

The value of empty nodes.

Can be used if you want to specify a value other than "" for empty nodes. ("" by default)

Sets the root node inside the resulting object.

(true by default)

Trim whitespace at the beginning and end of text nodes.

(false by default)

Ingore attributes.

Setting this to true will skip adding element attributes and create text nodes.

(false by default)

Merge attributes.

Merge all XML attributes and child elements as properties of the parent, instead of keying attributes off of the child attribute object. This option will be ignored if ignore_attrs is set.

(false by default)

Removes whitespace character data in text nodes.

This option will result in behavior that is a superset of trim. Whitespace at the beginning and end of text nodes will be trimmed. In addition, blank space (/s) between other text data will be converted to a single space (" "). Corresponds to the normalize option in node-xmlj2.

(false by default)

Normalize all tags by converting them to lowercase.

Corresponds to the normalizeTags option in node-xml2js.

(false by default)

Always put the child nodes in an array, otherwise an array is only created if there is more than one child.

(true by default)

Always store character data under charkey even if there are are no other text elements stored inside the tag.

(false by default)

Finalize configuration options and build a JsonBuilder instance

Trait Implementations

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.