Struct xml::writer::EventWriter [] [src]

pub struct EventWriter<W> {
    // some fields omitted
}

A wrapper around an std::io::Write instance which emits XML document according to provided events.

Methods

impl<W: Write> EventWriter<W>
[src]

fn new(sink: W) -> EventWriter<W>

Creates a new EventWriter out of an std::io::Write instance using the default configuration.

fn new_with_config(sink: W, config: EmitterConfig) -> EventWriter<W>

Creates a new EventWriter out of an std::io::Write instance using the provided configuration.

fn write<'a, E>(&mut self, event: E) -> Result<()> where E: Into<XmlEvent<'a>>

Writes the next piece of XML document according to the provided event.

Note that output data may not exactly correspond to the written event because of various configuration options. For example, XmlEvent::EndElement may correspond to a separate closing element or it may cause writing an empty element. Another example is that XmlEvent::CData may be represented as characters in the output stream.