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: bool
Do not convert text into paths.
Default: false
coordinates_precision: u8
Set the coordinates numeric precision.
Smaller precision can lead to a malformed output in some cases.
Default: 8
transforms_precision: u8
Set the transform values numeric precision.
Smaller precision can lead to a malformed output in some cases.
Default: 8
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
Trait Implementations§
source§impl Clone for WriteOptions
impl Clone for WriteOptions
source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
Returns a copy 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)