Struct svgdom::WriteOptions

source ·
pub struct WriteOptions {
    pub use_single_quote: bool,
    pub indent: Indent,
    pub attributes_indent: Indent,
    pub attributes_order: AttributesOrder,
    pub values: ValueWriteOptions,
}
Expand description

Options that defines SVG writing.

Fields

use_single_quote: bool

Use single quote marks instead of double quote.

Examples

Before:

<rect fill="red"/>

After:

<rect fill='red'/>

Default: disabled

indent: Indent

Set XML nodes indention.

Examples

Indent::None

Before:

<svg>
    <rect fill="red"/>
</svg>

After:

<svg><rect fill="red"/></svg>

Default: 4 spaces

attributes_indent: Indent

Set XML attributes indention.

Examples

Indent::Spaces(2)

Before:

<svg>
    <rect fill="red" stroke="black"/>
</svg>

After:

<svg>
    <rect
      fill="red"
      stroke="black"/>
</svg>

Default: None

attributes_order: AttributesOrder

Set attributes order.

Default: AttributesOrder::Alphabetical

values: ValueWriteOptions

svgtypes options.

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

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.