pub struct TreeBuilder { /* private fields */ }Expand description
HTML5 tree builder.
Constructs a DOM tree from a stream of tokens.
Implementations§
Source§impl TreeBuilder
impl TreeBuilder
Sourcepub fn set_fragment_mode(&mut self, fragment: bool)
pub fn set_fragment_mode(&mut self, fragment: bool)
Set fragment mode (for parsing HTML fragments).
In fragment mode the tree builder skips implicit <html>,
<head>, and <body> creation and inserts directly into
document.root which acts as a virtual container.
Sourcepub fn process_token(&mut self, token: Token)
pub fn process_token(&mut self, token: Token)
Process a token.
Sourcepub fn finish_fragment(self) -> Vec<Node>
pub fn finish_fragment(self) -> Vec<Node>
Finish building and return fragment nodes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeBuilder
impl RefUnwindSafe for TreeBuilder
impl Send for TreeBuilder
impl Sync for TreeBuilder
impl Unpin for TreeBuilder
impl UnwindSafe for TreeBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more