pub struct XmlWriter<W: Write> { /* private fields */ }Expand description
A low-level XML writer providing indented output for 3MF XML serialization.
Implementations§
Source§impl<W: Write> XmlWriter<W>
impl<W: Write> XmlWriter<W>
Sourcepub fn new(inner: W) -> Self
pub fn new(inner: W) -> Self
Creates a new XmlWriter wrapping the given writer with 2-space indentation.
Sourcepub fn write_declaration(&mut self) -> Result<()>
pub fn write_declaration(&mut self) -> Result<()>
Writes the XML declaration (<?xml version="1.0" encoding="UTF-8"?>).
Sourcepub fn start_element(&mut self, name: &str) -> ElementBuilder<'_, W>
pub fn start_element(&mut self, name: &str) -> ElementBuilder<'_, W>
Returns an ElementBuilder for constructing and writing a start or empty element.
Sourcepub fn end_element(&mut self, name: &str) -> Result<()>
pub fn end_element(&mut self, name: &str) -> Result<()>
Writes a closing tag for the given element name.
Sourcepub fn write_text(&mut self, text: &str) -> Result<()>
pub fn write_text(&mut self, text: &str) -> Result<()>
Writes a text node with the given content.
Auto Trait Implementations§
impl<W> Freeze for XmlWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for XmlWriter<W>where
W: RefUnwindSafe,
impl<W> Send for XmlWriter<W>where
W: Send,
impl<W> Sync for XmlWriter<W>where
W: Sync,
impl<W> Unpin for XmlWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for XmlWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for XmlWriter<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more