Enum svgparser::svg::Token [] [src]

pub enum Token<'a> {
    Declaration(&'a strOption<&'a str>, Option<&'a str>),
    ProcessingInstruction(&'a strOption<&'a str>),
    EntityDeclaration(&'a strStrSpan<'a>),
    Comment(&'a str),
    ElementStart(TagName<'a>),
    ElementEnd(ElementEnd<'a>),
    Attribute(AttrName<'a>, StrSpan<'a>),
    Text(StrSpan<'a>),
    Cdata(StrSpan<'a>),
    Whitespaces(&'a str),
}

SVG token.

Variants

XML declaration token.

Example: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -> ("1.0", "UTF-8", "yes")

XML processing instruction token.

Example: <?target content?> -> ("target", "content")

The ENTITY token.

Can appear only inside the DTD. We emit only entities with EntityValue. ExternalID skipped.

Example: <!ENTITY ns_extend "http://test.com"> -> ("ns_extend", "http://test.com")

Comment token.

Example: <!-- text --> -> " text "

Element start token.

Example:

<nonsvg ... -> "nonsvg"

<svg ... -> ElementId::SVG

Element end token.

See ElementEnd doc for example.

Attribute token.

Example:

name="value" -> ("name", "value")

fill="red" -> (AttributeId::Fill, "red")

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> -> "text"

CDATA token.

Example: <![CDATA[text]]> -> "text"

Whitespaces token.

It will contain only whitespace characters like \n \t\r and escaped version of them, like &#x20;.

If there is a text between elements - Whitespace will not be emitted at all.

Example: <rect/>\n<rect/> -> "\n"

Trait Implementations

impl<'a> Debug for Token<'a>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> Send for Token<'a>

impl<'a> Sync for Token<'a>