pub struct PrettyDisplay<'a, E> { /* private fields */ }
Expand description
A pretty-printer for XML elements.
Implementations§
Source§impl<'a, E> PrettyDisplay<'a, E>
impl<'a, E> PrettyDisplay<'a, E>
Sourcepub fn indent_width(self, indent_width: usize) -> Self
pub fn indent_width(self, indent_width: usize) -> Self
Set the indentation width.
Sourcepub fn line_separator(self, line_separator: &'a str) -> Self
pub fn line_separator(self, line_separator: &'a str) -> Self
Set the line separator. Usually it’s either "\n"
or ""
.
Sourcepub fn no_autoclose(self) -> Self
pub fn no_autoclose(self) -> Self
Disable the />
syntax.
§Example
let element = nxml!(<Entity><Child/></Entity>);
assert_eq!(element.display().compact().no_autoclose().to_string(), "<Entity><Child></Child></Entity>");
Trait Implementations§
Source§impl<'a, E: Debug> Debug for PrettyDisplay<'a, E>
impl<'a, E: Debug> Debug for PrettyDisplay<'a, E>
Auto Trait Implementations§
impl<'a, E> Freeze for PrettyDisplay<'a, E>
impl<'a, E> RefUnwindSafe for PrettyDisplay<'a, E>where
E: RefUnwindSafe,
impl<'a, E> Send for PrettyDisplay<'a, E>where
E: Sync,
impl<'a, E> Sync for PrettyDisplay<'a, E>where
E: Sync,
impl<'a, E> Unpin for PrettyDisplay<'a, E>
impl<'a, E> UnwindSafe for PrettyDisplay<'a, E>where
E: RefUnwindSafe,
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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more