#[non_exhaustive]pub struct SerializeOpts {
pub indent: Option<String>,
pub self_close_empty: bool,
}Expand description
Options for Markdown::to_xml.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.indent: Option<String>Indentation string. When set, child elements are nested on their own
lines with this prefix per level. None yields tight, single-line output.
self_close_empty: boolWhen true, empty elements are emitted as self-closing tags
(<tag/>). When false, they stay as <tag></tag> unless the source
already used self-close syntax.
Implementations§
Source§impl SerializeOpts
impl SerializeOpts
Sourcepub fn new() -> Self
pub fn new() -> Self
Tight defaults — no indentation, no empty-tag collapsing. Equivalent
to SerializeOpts::default; provided as the conventional
constructor pair for types that also implement Default.
Sourcepub fn with_indent(self, indent: impl Into<String>) -> Self
pub fn with_indent(self, indent: impl Into<String>) -> Self
Set the indentation prefix; each nested child is prefixed with one
copy of indent per level. Pair with Self::compact to switch
back to single-line output.
Sourcepub fn self_close_empty(self) -> Self
pub fn self_close_empty(self) -> Self
Collapse empty elements to <tag/>.
Sourcepub fn expand_empty(self) -> Self
pub fn expand_empty(self) -> Self
Keep empty elements as <tag></tag> (unless the source already used
self-close form, which is always preserved).
Trait Implementations§
Source§impl Clone for SerializeOpts
impl Clone for SerializeOpts
Source§fn clone(&self) -> SerializeOpts
fn clone(&self) -> SerializeOpts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SerializeOpts
impl Debug for SerializeOpts
Source§impl Default for SerializeOpts
impl Default for SerializeOpts
Source§fn default() -> SerializeOpts
fn default() -> SerializeOpts
Source§impl PartialEq for SerializeOpts
impl PartialEq for SerializeOpts
Source§fn eq(&self, other: &SerializeOpts) -> bool
fn eq(&self, other: &SerializeOpts) -> bool
self and other values to be equal, and is used by ==.