Enum ParserErrorKind

Source
pub enum ParserErrorKind {
Show 17 variants SecondRootSection { label: String, }, SectionLevelTooDeep { level: usize, }, UnmatchedDoubleCloseBrace, UnmatchedDoubleOpenBrace, UnmatchedDoubleCloseBracket, UnmatchedDoubleOpenBracket, UnmatchedNoWikiClose, UnmatchedNoWikiOpen, UnexpectedTokenInTag { token: String, }, UnexpectedTokenInParameter { token: String, }, UnexpectedTokenInLink { token: String, }, UnexpectedTokenInLinkLabel { token: String, }, UnexpectedTokenInFormattedText { token: String, }, UnexpectedTokenInListItem { token: String, }, UnexpectedToken { expected: String, actual: String, }, UnclosedTextFormatting { formatting: TextFormatting, }, UnexpectedEof,
}
Expand description

The kind of parser error.

Variants§

§

SecondRootSection

Found a second root section, but only one is allowed.

Fields

§label: String

The label of the second root section.

§

SectionLevelTooDeep

Found a section at a level that is deeper than supported.

Fields

§level: usize

The too deep level.

§

UnmatchedDoubleCloseBrace

Found a double close brace that does not match any opened one.

§

UnmatchedDoubleOpenBrace

Found a double open brace that does not match any closed one.

§

UnmatchedDoubleCloseBracket

Found a double close bracket that does not match any opened one.

§

UnmatchedDoubleOpenBracket

Found a double open bracket that does not match any closed one.

§

UnmatchedNoWikiClose

Found a </nowiki> that does not match any <nowiki>.

§

UnmatchedNoWikiOpen

Found a <nowiki> that does not match any </nowiki>.

§

UnexpectedTokenInTag

A tag contains a token that does not belong there.

Fields

§token: String

The unexpected token.

§

UnexpectedTokenInParameter

A parameter contains a token that does not belong there.

Fields

§token: String

The unexpected token.

A link contains a token that does not belong there.

Fields

§token: String

The unexpected token.

§

UnexpectedTokenInLinkLabel

A link label contains a token that does not belong there.

Fields

§token: String

The unexpected token.

§

UnexpectedTokenInFormattedText

A formatted piece of text contains a token that does not belong there.

Fields

§token: String

The unexpected token.

§

UnexpectedTokenInListItem

A link label contains a token that does not belong there.

Fields

§token: String

The unexpected token.

§

UnexpectedToken

A token was found at a place where it does not belong.

Fields

§expected: String

The expected token, or a list of possible expected tokens.

§actual: String

The token that was found.

§

UnclosedTextFormatting

A text formatting expression was not closed.

Fields

§formatting: TextFormatting

The unclosed formatting expression.

§

UnexpectedEof

The end of file was found, but further tokens were expected.

Trait Implementations§

Source§

impl Debug for ParserErrorKind

Source§

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

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

impl Display for ParserErrorKind

Source§

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

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

impl PartialEq for ParserErrorKind

Source§

fn eq(&self, other: &ParserErrorKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ParserErrorKind

Source§

impl StructuralPartialEq for ParserErrorKind

Auto Trait Implementations§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.