[][src]Enum parse_wiki_text::Node

pub enum Node<'a> {
    Bold {
        end: usize,
        start: usize,
    },
    BoldItalic {
        end: usize,
        start: usize,
    },
    Category {
        end: usize,
        ordinal: Vec<Node<'a>>,
        start: usize,
        target: &'a str,
    },
    CharacterEntity {
        character: char,
        end: usize,
        start: usize,
    },
    Comment {
        end: usize,
        start: usize,
    },
    DefinitionList {
        end: usize,
        items: Vec<DefinitionListItem<'a>>,
        start: usize,
    },
    EndTag {
        end: usize,
        name: Cow<'a, str>,
        start: usize,
    },
    ExternalLink {
        end: usize,
        nodes: Vec<Node<'a>>,
        start: usize,
    },
    Heading {
        end: usize,
        level: u8,
        nodes: Vec<Node<'a>>,
        start: usize,
    },
    HorizontalDivider {
        end: usize,
        start: usize,
    },
    Image {
        end: usize,
        start: usize,
        target: &'a str,
        text: Vec<Node<'a>>,
    },
    Italic {
        end: usize,
        start: usize,
    },
    Link {
        end: usize,
        start: usize,
        target: &'a str,
        text: Vec<Node<'a>>,
    },
    MagicWord {
        end: usize,
        start: usize,
    },
    OrderedList {
        end: usize,
        items: Vec<ListItem<'a>>,
        start: usize,
    },
    ParagraphBreak {
        end: usize,
        start: usize,
    },
    Parameter {
        default: Option<Vec<Node<'a>>>,
        end: usize,
        name: Vec<Node<'a>>,
        start: usize,
    },
    Preformatted {
        end: usize,
        nodes: Vec<Node<'a>>,
        start: usize,
    },
    Redirect {
        end: usize,
        target: &'a str,
        start: usize,
    },
    StartTag {
        end: usize,
        name: Cow<'a, str>,
        start: usize,
    },
    Table {
        attributes: Vec<Node<'a>>,
        captions: Vec<TableCaption<'a>>,
        end: usize,
        rows: Vec<TableRow<'a>>,
        start: usize,
    },
    Tag {
        end: usize,
        name: Cow<'a, str>,
        nodes: Vec<Node<'a>>,
        start: usize,
    },
    Template {
        end: usize,
        name: Vec<Node<'a>>,
        parameters: Vec<Parameter<'a>>,
        start: usize,
    },
    Text {
        end: usize,
        start: usize,
        value: &'a str,
    },
    UnorderedList {
        end: usize,
        items: Vec<ListItem<'a>>,
        start: usize,
    },
}

Parsed node.

Variants

Bold

Toggle bold text. Parsed from the code '''.

Fields of Bold

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

BoldItalic

Toggle bold and italic text. Parsed from the code '''''.

Fields of BoldItalic

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

Category

Category. Parsed from code starting with [[, a category namespace and :.

Fields of Category

end: usize

The byte position in the wiki text where the element ends.

ordinal: Vec<Node<'a>>

Additional information for sorting entries on the category page, if any.

start: usize

The byte position in the wiki text where the element starts.

target: &'a str

The category referred to.

CharacterEntity

Character entity. Parsed from code starting with & and ending with ;.

Fields of CharacterEntity

character: char

The character represented.

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

Comment

Comment. Parsed from code starting with <!--.

Fields of Comment

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

DefinitionList

Definition list. Parsed from code starting with : or ;.

Fields of DefinitionList

end: usize

The byte position in the wiki text where the element ends.

items: Vec<DefinitionListItem<'a>>

The list items of the list.

start: usize

The byte position in the wiki text where the element starts.

EndTag

End tag. Parsed from code starting with </ and a valid tag name.

Fields of EndTag

end: usize

The byte position in the wiki text where the element ends.

name: Cow<'a, str>

The tag name.

start: usize

The byte position in the wiki text where the element starts.

ExternalLink

External link. Parsed from code starting with [ and a valid protocol.

Fields of ExternalLink

end: usize

The byte position in the wiki text where the element ends.

nodes: Vec<Node<'a>>

The content of the element.

start: usize

The byte position in the wiki text where the element starts.

Heading

Heading. Parsed from code starting with = and ending with =.

Fields of Heading

end: usize

The byte position in the wiki text where the element ends.

level: u8

The level of the heading from 1 to 6.

nodes: Vec<Node<'a>>

The content of the element.

start: usize

The byte position in the wiki text where the element starts.

HorizontalDivider

Horizontal divider. Parsed from code starting with ----.

Fields of HorizontalDivider

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

Image

Image. Parsed from code starting with [[, a file namespace and :.

Fields of Image

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

target: &'a str

The file name of the image.

text: Vec<Node<'a>>

Additional information for the image.

Italic

Toggle italic text. Parsed from the code ''.

Fields of Italic

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

Link

Link. Parsed from code starting with [[ and ending with ]].

Fields of Link

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

target: &'a str

The target of the link.

text: Vec<Node<'a>>

The text to display for the link.

MagicWord

Magic word. Parsed from the code __, a valid magic word and __.

Fields of MagicWord

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

OrderedList

Ordered list. Parsed from code starting with #.

Fields of OrderedList

end: usize

The byte position in the wiki text where the element ends.

items: Vec<ListItem<'a>>

The list items of the list.

start: usize

The byte position in the wiki text where the element starts.

ParagraphBreak

Paragraph break. Parsed from an empty line between elements that can appear within a paragraph.

Fields of ParagraphBreak

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

Parameter

Parameter. Parsed from code starting with {{{ and ending with }}}.

Fields of Parameter

default: Option<Vec<Node<'a>>>

The default value of the parameter.

end: usize

The byte position in the wiki text where the element ends.

name: Vec<Node<'a>>

The name of the parameter.

start: usize

The byte position in the wiki text where the element starts.

Preformatted

Block of preformatted text. Parsed from code starting with a space at the beginning of a line.

Fields of Preformatted

end: usize

The byte position in the wiki text where the element ends.

nodes: Vec<Node<'a>>

The content of the element.

start: usize

The byte position in the wiki text where the element starts.

Redirect

Redirect. Parsed at the start of the wiki text from code starting with # followed by a redirect magic word.

Fields of Redirect

end: usize

The byte position in the wiki text where the element ends.

target: &'a str

The target of the redirect.

start: usize

The byte position in the wiki text where the element starts.

StartTag

Start tag. Parsed from code starting with < and a valid tag name.

Fields of StartTag

end: usize

The byte position in the wiki text where the element ends.

name: Cow<'a, str>

The tag name.

start: usize

The byte position in the wiki text where the element starts.

Table

Table. Parsed from code starting with {|.

Fields of Table

attributes: Vec<Node<'a>>

The HTML attributes of the element.

captions: Vec<TableCaption<'a>>

The captions of the table.

end: usize

The byte position in the wiki text where the element ends.

rows: Vec<TableRow<'a>>

The rows of the table.

start: usize

The byte position in the wiki text where the element starts.

Tag

Extension tag. Parsed from code starting with < and the tag name of a valid extension tag.

Fields of Tag

end: usize

The byte position in the wiki text where the element ends.

name: Cow<'a, str>

The tag name.

nodes: Vec<Node<'a>>

The content of the tag, between the start tag and the end tag, if any.

start: usize

The byte position in the wiki text where the element starts.

Template

Template. Parsed from code starting with {{ and ending with }}.

Fields of Template

end: usize

The byte position in the wiki text where the element ends.

name: Vec<Node<'a>>

The name of the template.

parameters: Vec<Parameter<'a>>

The parameters of the template.

start: usize

The byte position in the wiki text where the element starts.

Text

Plain text.

Fields of Text

end: usize

The byte position in the wiki text where the element ends.

start: usize

The byte position in the wiki text where the element starts.

value: &'a str

The text.

UnorderedList

Unordered list. Parsed from code starting with *.

Fields of UnorderedList

end: usize

The byte position in the wiki text where the element ends.

items: Vec<ListItem<'a>>

The list items of the list.

start: usize

The byte position in the wiki text where the element starts.

Trait Implementations

impl<'a> Positioned for Node<'a>[src]

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

Auto Trait Implementations

impl<'a> Send for Node<'a>

impl<'a> Sync for Node<'a>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]