Enum Node

Source
pub enum Node<'a> {
Show 25 variants 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, },
}
Expand description

Parsed node.

Variants§

§

Bold

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

Fields

§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

§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

§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

§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

§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

§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

§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.

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

Fields

§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

§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

§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

§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

§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. Parsed from code starting with [[ and ending with ]].

Fields

§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

§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

§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

§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

§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

§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

§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

§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

§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

§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

§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

§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

§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§

Source§

impl<'a> Debug for Node<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Positioned for Node<'a>

Source§

fn end(&self) -> usize

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

fn start(&self) -> usize

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

Auto Trait Implementations§

§

impl<'a> Freeze for Node<'a>

§

impl<'a> RefUnwindSafe for Node<'a>

§

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

§

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

§

impl<'a> Unpin for Node<'a>

§

impl<'a> UnwindSafe for Node<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.