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

pub struct EventWriter<W> { /* 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]

[src]

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

[src]

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

[src]

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.

[src]

Returns a mutable reference to the underlying Writer.

Note that having a reference to the underlying sink makes it very easy to emit invalid XML documents. Use this method with care. Valid use cases for this method include accessing methods like Write::flush, which do not emit new data but rather change the state of the stream itself.

[src]

Unwraps this EventWriter, returning the underlying writer.

Note that this is a destructive operation: unwrapping a writer and then wrapping it again with EventWriter::new() will create a fresh writer whose state will be blank; for example, accumulated namespaces will be reset.

Trait Implementations

Auto Trait Implementations

impl<W> Send for EventWriter<W> where
    W: Send

impl<W> Sync for EventWriter<W> where
    W: Sync