pub enum Event<'a> {
Start {
name: Cow<'a, str>,
attrs: Vec<(Cow<'a, str>, Cow<'a, str>)>,
},
End {
name: Cow<'a, str>,
implied: bool,
},
Text(Cow<'a, str>),
Comment(&'a str),
Doctype(&'a str),
}Expand description
One step of a document as the tree builder sees it, after recovery. See
events.
Every Start is matched by exactly one later End with the same name,
properly nested — including elements whose end tag was omitted or
misplaced, and void and self-closing elements, whose End follows
immediately.
Variants§
Start
An element starts.
Fields
End
An element ends.
Fields
Text(Cow<'a, str>)
Character data: entity-decoded, except inside <script>/<style>.
CDATA sections are text too. Adjacent text can arrive in several
pieces (a stray < is its own piece), exactly like the tree’s text
nodes.
Comment(&'a str)
The body of a comment (or of a bogus comment like <?xml …>).
Doctype(&'a str)
The body of a <!doctype …>, trimmed.
Trait Implementations§
impl<'a> Eq for Event<'a>
impl<'a> StructuralPartialEq for Event<'a>
Auto Trait Implementations§
impl<'a> Freeze for Event<'a>
impl<'a> RefUnwindSafe for Event<'a>
impl<'a> Send for Event<'a>
impl<'a> Sync for Event<'a>
impl<'a> Unpin for Event<'a>
impl<'a> UnsafeUnpin for Event<'a>
impl<'a> UnwindSafe for Event<'a>
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