pub struct XmlWriter<W: Write> { /* private fields */ }Expand description
An XML writer that produces well-formed XML output.
Implementations§
Source§impl<W: Write> XmlWriter<W>
impl<W: Write> XmlWriter<W>
Sourcepub fn with_indent(writer: W, indent: IndentConfig) -> Self
pub fn with_indent(writer: W, indent: IndentConfig) -> Self
Creates a new XML writer with indentation.
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Returns the inner writer.
Sourcepub fn write_declaration(
&mut self,
version: &str,
encoding: Option<&str>,
) -> Result<()>
pub fn write_declaration( &mut self, version: &str, encoding: Option<&str>, ) -> Result<()>
Writes the XML declaration.
Sourcepub fn start_element(&mut self, name: &str) -> Result<()>
pub fn start_element(&mut self, name: &str) -> Result<()>
Starts an element.
Sourcepub fn write_attribute(&mut self, name: &str, value: &str) -> Result<()>
pub fn write_attribute(&mut self, name: &str, value: &str) -> Result<()>
Writes an attribute for the current element.
Sourcepub fn end_element(&mut self) -> Result<()>
pub fn end_element(&mut self) -> Result<()>
Ends the current element.
Sourcepub fn write_text(&mut self, text: &str) -> Result<()>
pub fn write_text(&mut self, text: &str) -> Result<()>
Writes text content.
Sourcepub fn write_cdata(&mut self, data: &str) -> Result<()>
pub fn write_cdata(&mut self, data: &str) -> Result<()>
Writes a CDATA section.
Sourcepub fn write_comment(&mut self, comment: &str) -> Result<()>
pub fn write_comment(&mut self, comment: &str) -> Result<()>
Writes a comment.
Sourcepub fn write_pi(&mut self, target: &str, data: Option<&str>) -> Result<()>
pub fn write_pi(&mut self, target: &str, data: Option<&str>) -> Result<()>
Writes a processing instruction.
Sourcepub fn write_element(&mut self, name: &str, content: &str) -> Result<()>
pub fn write_element(&mut self, name: &str, content: &str) -> Result<()>
Writes a complete element with text content.
Sourcepub fn write_empty_element(&mut self, name: &str) -> Result<()>
pub fn write_empty_element(&mut self, name: &str) -> Result<()>
Writes an empty element.
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> UnwindSafe for XmlWriter<W>where
W: UnwindSafe,
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