pub enum Token<'a> {
OpenTag {
tag: Tag,
name: Cow<'a, str>,
attributes: Vec<Attribute<'a>>,
self_closing: bool,
},
CloseTag {
tag: Tag,
name: Cow<'a, str>,
},
Text {
content: Cow<'a, str>,
},
Comment {
content: Cow<'a, str>,
},
Doctype {
content: Cow<'a, str>,
},
CData {
content: Cow<'a, str>,
},
}Expand description
A single token produced by the tokenizer.
All string payloads borrow from the original input ('a lifetime),
except entity-decoded values which use Cow::Owned.
Variants§
OpenTag
An opening tag, e.g. <div class="foo">.
Fields
CloseTag
A closing tag, e.g. </div>.
Text
Text content between tags.
Comment
An HTML comment, e.g. <!-- comment -->.
Doctype
A DOCTYPE declaration, e.g. <!DOCTYPE html>.
CData
A CDATA section, e.g. <![CDATA[...]]>.
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