Struct xml5ever::serialize::Serializer
[−]
[src]
pub struct Serializer<'wr, Wr: 'wr> { /* fields omitted */ }
Struct used for serializing nodes into a text that other XML parses can read.
Serializer contains a set of functions (start_elem, end_elem...) that make parsing nodes easier.
Methods
impl<'wr, Wr: Write> Serializer<'wr, Wr>
[src]
fn new(writer: &'wr mut Wr, opts: SerializeOpts) -> Serializer<'wr, Wr>
Creates a new Serializier from a writer and given serialization options.
fn start_elem<'a, AttrIter: Iterator<Item = AttrRef<'a>>>(
&mut self,
name: QName,
attrs: AttrIter
) -> Result<()>
&mut self,
name: QName,
attrs: AttrIter
) -> Result<()>
Serializes given start element into text. Start element contains qualified name and an attributes iterator.
fn end_elem(&mut self, name: QName) -> Result<()>
Serializes given end element into text.
fn write_comment(&mut self, text: &str) -> Result<()>
Serializes comment into text.
fn write_doctype(&mut self, name: &str) -> Result<()>
Serializes given doctype
fn write_text(&mut self, text: &str) -> Result<()>
Serializes text for a node or an attributes.
fn write_processing_instruction(
&mut self,
target: &str,
data: &str
) -> Result<()>
&mut self,
target: &str,
data: &str
) -> Result<()>
Serializes given processing instruction.