pub struct WriteOptions {
pub id_prefix: Option<String>,
pub preserve_text: bool,
pub coordinates_precision: u8,
pub transforms_precision: u8,
pub use_single_quote: bool,
pub indent: Indent,
pub attributes_indent: Indent,
}Expand description
XML writing options.
Fields§
§id_prefix: Option<String>Used to add a custom prefix to each element ID during writing.
preserve_text: boolDo not convert text into paths.
Default: false
coordinates_precision: u8Set the coordinates numeric precision.
Smaller precision can lead to a malformed output in some cases.
Default: 8
transforms_precision: u8Set the transform values numeric precision.
Smaller precision can lead to a malformed output in some cases.
Default: 8
use_single_quote: boolUse single quote marks instead of double quote.
§Examples
Before:
<rect fill="red"/>After:
<rect fill='red'/>Default: disabled
indent: IndentSet XML nodes indention.
§Examples
Indent::None
Before:
<svg>
<rect fill="red"/>
</svg>After:
<svg><rect fill="red"/></svg>Default: 4 spaces
attributes_indent: IndentSet 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
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WriteOptions
impl Debug for WriteOptions
Auto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptions
impl Sync for WriteOptions
impl Unpin for WriteOptions
impl UnwindSafe for WriteOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more