pub trait TreeSink {
// Required methods
fn open_tag(
&mut self,
tag: Tag,
name: &str,
attr_raw: &str,
self_closing: bool,
);
fn close_tag(&mut self, tag: Tag, name: &str);
fn text(&mut self, content: &str);
fn comment(&mut self, content: &str);
fn doctype(&mut self, content: &str);
fn cdata(&mut self, content: &str);
}Expand description
Trait for receiving parsed HTML events directly, bypassing Token allocation.
Implementors receive raw parse events (open/close tags, text, etc.) and
can build their output structure in a single pass without intermediate
Token enum or Vec<Attribute> allocations.
Required Methods§
Sourcefn open_tag(&mut self, tag: Tag, name: &str, attr_raw: &str, self_closing: bool)
fn open_tag(&mut self, tag: Tag, name: &str, attr_raw: &str, self_closing: bool)
An opening tag was encountered.
attr_raw is the raw attribute region between the tag name and >.
The implementor is responsible for parsing attributes from this slice.