Trait xml5ever::serialize::Serializer
source · pub trait Serializer {
// Required methods
fn start_elem<'a, AttrIter>(
&mut self,
name: QualName,
attrs: AttrIter,
) -> Result<(), Error>
where AttrIter: Iterator<Item = (&'a QualName, &'a str)>;
fn end_elem(&mut self, name: QualName) -> Result<(), Error>;
fn write_text(&mut self, text: &str) -> Result<(), Error>;
fn write_comment(&mut self, text: &str) -> Result<(), Error>;
fn write_doctype(&mut self, name: &str) -> Result<(), Error>;
fn write_processing_instruction(
&mut self,
target: &str,
data: &str,
) -> Result<(), Error>;
}
Expand description
Types that are capable of serializing implement this trait
Required Methods§
sourcefn start_elem<'a, AttrIter>(
&mut self,
name: QualName,
attrs: AttrIter,
) -> Result<(), Error>
fn start_elem<'a, AttrIter>( &mut self, name: QualName, attrs: AttrIter, ) -> Result<(), Error>
Serialize the start of an element, for example <div class="test">
.
sourcefn end_elem(&mut self, name: QualName) -> Result<(), Error>
fn end_elem(&mut self, name: QualName) -> Result<(), Error>
Serialize the end of an element, for example </div>
.
sourcefn write_comment(&mut self, text: &str) -> Result<(), Error>
fn write_comment(&mut self, text: &str) -> Result<(), Error>
Serialize a comment node, for example <!-- comment -->
.
Object Safety§
This trait is not object safe.