pub enum Token<'a> {
StartTag {
name: &'a str,
attrs: Vec<(&'a str, AttrValue<'a>)>,
self_closing: bool,
},
EndTag {
name: &'a str,
},
Text(&'a str),
Comment(&'a str),
Doctype(&'a str),
Cdata(&'a str),
}Expand description
A single lexical token of HTML.
Variants§
StartTag
A start tag such as <div class="x"> or a self-closing <br/>.
Fields
EndTag
An end tag such as </div>.
Text(&'a str)
A run of character data. Raw (undecoded) slice of the source.
Comment(&'a str)
The inner text of an <!-- ... --> comment (or a bogus comment).
Doctype(&'a str)
The inner text of a <!doctype ...> declaration.
Cdata(&'a str)
The inner text of a <![CDATA[ ... ]]> section.
Trait Implementations§
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> Freeze for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnsafeUnpin for Token<'a>
impl<'a> UnwindSafe for Token<'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