Struct xml_writer::XmlWriter [] [src]

pub struct XmlWriter<'a, W: Write> {
    pub pretty: bool,
    // some fields omitted
}

Fields

pretty: bool

Methods

impl<'a, W: Write> XmlWriter<'a, W>
[src]

fn new(writer: W) -> XmlWriter<'a, W>

fn dtd(&mut self, encoding: &str) -> Result

Write the DTD

fn elem(&mut self, name: &str) -> Result

Write a self-closing element like

fn elem_text(&mut self, name: &str, text: &str) -> Result

Write an element with inlined text (escaped)

fn begin_elem(&mut self, name: &'a str) -> Result

Begin an elem, make sure name contains only allowed chars

fn end_elem(&mut self) -> Result

End and elem

fn attr(&mut self, name: &str, value: &str) -> Result

Write an attr, make sure name and value contain only allowed chars. For an escaping version use attr_esc

fn attr_esc(&mut self, name: &str, value: &str) -> Result

Write an attr, make sure name contains only allowed chars

fn text(&mut self, text: &str) -> Result

Write a text, escapes the text automatically

fn write(&mut self, text: &str) -> Result

Raw write, no escaping, no safety net, use at own risk

fn cdata(&mut self, cdata: &str) -> Result

Write a CDATA

fn comment(&mut self, comment: &str) -> Result

Write a comment

fn close(&mut self) -> Result

Close all open elems

fn flush(&mut self) -> Result

Flush the underlying Writer

fn into_inner(self) -> W

Consume the XmlWriter and return the inner Writer

Trait Implementations

impl<'a, W: Write> Debug for XmlWriter<'a, W>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.