pub struct XmlFormatOptions {
pub root_tag: Option<String>,
pub item_tag: String,
pub none_str: String,
pub indent: Option<String>,
}Expand description
Options for XML formatting.
Fields§
§root_tag: Option<String>Root tag name. If None, no root tag is added.
item_tag: StringTag name for items in sequences.
none_str: StringString representation for None values.
indent: Option<String>Indentation string (None for compact output).
Implementations§
Source§impl XmlFormatOptions
impl XmlFormatOptions
Sourcepub fn new() -> XmlFormatOptions
pub fn new() -> XmlFormatOptions
Create new options with default values.
Sourcepub fn with_root_tag(self, tag: impl Into<String>) -> XmlFormatOptions
pub fn with_root_tag(self, tag: impl Into<String>) -> XmlFormatOptions
Set the root tag.
Sourcepub fn with_item_tag(self, tag: impl Into<String>) -> XmlFormatOptions
pub fn with_item_tag(self, tag: impl Into<String>) -> XmlFormatOptions
Set the item tag for sequences.
Sourcepub fn with_none_str(self, s: impl Into<String>) -> XmlFormatOptions
pub fn with_none_str(self, s: impl Into<String>) -> XmlFormatOptions
Set the none string representation.
Sourcepub fn with_indent(self, indent: Option<String>) -> XmlFormatOptions
pub fn with_indent(self, indent: Option<String>) -> XmlFormatOptions
Set the indentation string. None for compact output.
Sourcepub fn compact(self) -> XmlFormatOptions
pub fn compact(self) -> XmlFormatOptions
Disable indentation for compact output.
Trait Implementations§
Source§impl Clone for XmlFormatOptions
impl Clone for XmlFormatOptions
Source§fn clone(&self) -> XmlFormatOptions
fn clone(&self) -> XmlFormatOptions
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 XmlFormatOptions
impl Debug for XmlFormatOptions
Source§impl Default for XmlFormatOptions
impl Default for XmlFormatOptions
Source§fn default() -> XmlFormatOptions
fn default() -> XmlFormatOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for XmlFormatOptions
impl RefUnwindSafe for XmlFormatOptions
impl Send for XmlFormatOptions
impl Sync for XmlFormatOptions
impl Unpin for XmlFormatOptions
impl UnwindSafe for XmlFormatOptions
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