Struct norad::WriteOptions[][src]

pub struct WriteOptions { /* fields omitted */ }
Expand description

Options that can be set when writing the UFO to disk.

You construct WriteOptions using builder semantics:

let single_tab = WriteOptions::default();

let two_tabs = WriteOptions::default()
    .whitespace("\t\t");

let spaces = WriteOptions::default()
    .whitespace("  ");

let spaces_and_singlequotes = WriteOptions::default()
    .whitespace("  ")
    .quote_char(QuoteChar::Single);

Implementations

Builder-style method to customize the whitespace.

By default, we indent with a single tab (“\t”).

The argument, may be either a 'static str or a String. You should prefer to use a 'static str where possible.

The string can contain any number of a single ASCII character, but must not contain multiple different characters. As an example, “\t\t” is fine, but “\t \t” is not, because it contains both tabs and spaces.

This is not good API, but is a work around for the fact that the quick-xml and plist crates both represent whitespace in different ways.

Panics

Panics if the provided string is empty, or if it contains multiple different characters.

Builder-style method to customize the XML declaration attribute definition quote char.

By default, we indent with double quotes.

The quote style is defined with a QuoteChar enum argument.

Return a reference to XmlWriteOptions for use with the plist crate.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.