Enum xmlparser::Token [−][src]
pub enum Token<'a> { Declaration(StrSpan<'a>, Option<StrSpan<'a>>, Option<StrSpan<'a>>), ProcessingInstruction(StrSpan<'a>, Option<StrSpan<'a>>), Comment(StrSpan<'a>), DtdStart(StrSpan<'a>, Option<ExternalId<'a>>), EmptyDtd(StrSpan<'a>, Option<ExternalId<'a>>), EntityDeclaration(StrSpan<'a>, EntityDefinition<'a>), DtdEnd, ElementStart(StrSpan<'a>, StrSpan<'a>), Attribute((StrSpan<'a>, StrSpan<'a>), StrSpan<'a>), ElementEnd(ElementEnd<'a>), Text(StrSpan<'a>), Whitespaces(StrSpan<'a>), Cdata(StrSpan<'a>), }
An XML token.
Variants
Declaration(StrSpan<'a>, Option<StrSpan<'a>>, Option<StrSpan<'a>>)
Declaration token.
Version, encoding and standalone.
Example: <?xml version="1.0"?>
ProcessingInstruction(StrSpan<'a>, Option<StrSpan<'a>>)
Processing instruction token.
Example: <?target content?>
Comment(StrSpan<'a>)
The comment token.
Example: <!-- text -->
DtdStart(StrSpan<'a>, Option<ExternalId<'a>>)
DOCTYPE start token.
Example: <!DOCTYPE note [
EmptyDtd(StrSpan<'a>, Option<ExternalId<'a>>)
Empty DOCTYPE token.
Example: <!DOCTYPE note>
EntityDeclaration(StrSpan<'a>, EntityDefinition<'a>)
ENTITY token.
Can appear only inside the DTD.
Example: <!ENTITY ns_extend "http://test.com">
DtdEnd
DOCTYPE end token.
Example: ]>
ElementStart(StrSpan<'a>, StrSpan<'a>)
Element start token.
Contains prefix and local part of the qualified name.
Example: <elem
Attribute((StrSpan<'a>, StrSpan<'a>), StrSpan<'a>)
Attribute.
Contains prefix and local part of the qualified name and value.
Example: name="value"
ElementEnd(ElementEnd<'a>)
Element end token.
Text(StrSpan<'a>)
Text token.
Contains text between elements including whitespaces.
Basically everything between >
and <
.
Contains text as is. Use TextUnescape
to unescape it.
Example: <text>text</text>
Whitespaces(StrSpan<'a>)
Whitespaces token.
The same as Text
token, but contains only spaces.
Spaces can be encoded like  
.
Cdata(StrSpan<'a>)
CDATA token.
Example: <![CDATA[text]]>
Trait Implementations
impl<'a> Clone for Token<'a>
[src]
impl<'a> Clone for Token<'a>
fn clone(&self) -> Token<'a>
[src]
fn clone(&self) -> Token<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> Copy for Token<'a>
[src]
impl<'a> Copy for Token<'a>
impl<'a> PartialEq for Token<'a>
[src]
impl<'a> PartialEq for Token<'a>
fn eq(&self, other: &Token<'a>) -> bool
[src]
fn eq(&self, other: &Token<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Token<'a>) -> bool
[src]
fn ne(&self, other: &Token<'a>) -> bool
This method tests for !=
.
impl<'a> Debug for Token<'a>
[src]
impl<'a> Debug for Token<'a>