use crate::QualName;
use std::io;
#[derive(Clone, PartialEq)]
pub enum TraversalScope {
IncludeNode,
ChildrenOnly(Option<QualName>),
}
pub trait Serialize {
fn serialize<S>(&self, serializer: &mut S, traversal_scope: TraversalScope) -> io::Result<()>
where
S: Serializer;
}
pub trait Serializer {
fn start_elem<'a, AttrIter>(&mut self, name: QualName, attrs: AttrIter) -> io::Result<()>
where
AttrIter: Iterator<Item = AttrRef<'a>>;
fn end_elem(&mut self, name: QualName) -> io::Result<()>;
fn write_text(&mut self, text: &str) -> io::Result<()>;
fn write_comment(&mut self, text: &str) -> io::Result<()>;
fn write_doctype(&mut self, name: &str) -> io::Result<()>;
fn write_processing_instruction(&mut self, target: &str, data: &str) -> io::Result<()>;
}
pub type AttrRef<'a> = (&'a QualName, &'a str);