pub struct Writer<W>where
W: Write,{ /* private fields */ }Expand description
Writes a sequence of generic XML events to an underlying std::io::Write.
This is a thin wrapper around quick_xml::Writer, scoped to
xml-core’s own error type so that callers never need to depend on
quick_xml directly.
Implementations§
Source§impl<W> Writer<W>where
W: Write,
impl<W> Writer<W>where
W: Write,
Sourcepub fn write_event<'a, E>(&mut self, event: E) -> Result<(), Error>
pub fn write_event<'a, E>(&mut self, event: E) -> Result<(), Error>
Writes a single XML event to the underlying output.
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Consumes this writer, returning the underlying output.
Sourcepub fn write_raw(&mut self, xml: &str) -> Result<(), Error>
pub fn write_raw(&mut self, xml: &str) -> Result<(), Error>
Writes a pre-formed, already-valid fragment of UTF-8 XML directly to the underlying output, bypassing the event model entirely.
For embedding fixed, non-configurable XML content that has no need to be rebuilt one event at a time — e.g. a large, entirely static boilerplate payload a higher-level crate always writes verbatim. The caller is responsible for the fragment being well-formed and safe to splice in at its call site (no XML declaration, no dangling open tags, valid as a sequence of complete sibling elements).