Enum mediawiki_parser::Element [−][src]
pub enum Element { Document(Document), Heading(Heading), Text(Text), Formatted(Formatted), Paragraph(Paragraph), Template(Template), TemplateArgument(TemplateArgument), InternalReference(InternalReference), ExternalReference(ExternalReference), ListItem(ListItem), List(List), Table(Table), TableRow(TableRow), TableCell(TableCell), Comment(Comment), HtmlTag(HtmlTag), Gallery(Gallery), Error(Error), }
Element types used in the abstract syntax tree (AST).
Each element must keep track of its position in the original input document. After parsing, the document tree can be serialized by serde.
Variants
Document(Document)
Heading(Heading)
Text(Text)
Formatted(Formatted)
Paragraph(Paragraph)
Template(Template)
TemplateArgument(TemplateArgument)
InternalReference(InternalReference)
ExternalReference(ExternalReference)
ListItem(ListItem)
List(List)
Table(Table)
TableRow(TableRow)
TableCell(TableCell)
Comment(Comment)
HtmlTag(HtmlTag)
Gallery(Gallery)
Error(Error)
Methods
impl Element
[src]
impl Element
pub fn get_position(&self) -> &Span
[src]
pub fn get_position(&self) -> &Span
returns the source code position of an element.
pub fn get_position_mut(&mut self) -> &mut Span
[src]
pub fn get_position_mut(&mut self) -> &mut Span
returns a mutable reference the source code position of an element.
pub fn get_variant_name(&self) -> &str
[src]
pub fn get_variant_name(&self) -> &str
returns the variant name of an element.
Trait Implementations
impl Debug for Element
[src]
impl Debug for Element
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Element
[src]
impl PartialEq for Element
fn eq(&self, other: &Element) -> bool
[src]
fn eq(&self, other: &Element) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Element) -> bool
[src]
fn ne(&self, other: &Element) -> bool
This method tests for !=
.
impl Clone for Element
[src]
impl Clone for Element