Struct nxml_rs::PrettyDisplay
source · 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