[][src]Enum twilight_mention::parse::ParseMentionError

pub enum ParseMentionError<'a> {
    IdNotU64 {
        found: &'a str,
        source: ParseIntError,
    },
    LeadingArrow {
        found: Option<char>,
    },
    PartMissing {
        expected: usize,
        found: usize,
    },
    Sigil {
        expected: &'a [&'a str],
        found: Option<char>,
    },
    TrailingArrow {
        found: Option<char>,
    },
}

Parsing a mention failed due to invalid syntax.

Variants

IdNotU64

ID portion of the mention isn't a u64.

Fields of IdNotU64

found: &'a str

String that could not be parsed into a u64.

source: ParseIntError

Reason for the error.

LeadingArrow

Leading arrow (<) is not present.

Fields of LeadingArrow

found: Option<char>

Character that was instead found where the leading arrow should be.

PartMissing

One or more parts of the mention are missing.

For example, an emoji mention - <:name:id> - has two parts: the name and the id, separated by the sigil (:). If the second sigil denoting the second part can't be found, then it is missing.

Fields of PartMissing

expected: usize

Number of parts that are expected.

found: usize

Number of parts that have been found.

Sigil

Mention's sigil is not present.

Users, for example, have the sigil @.

Fields of Sigil

expected: &'a [&'a str]

Possible sigils that were expected for the mention type.

found: Option<char>

Character that was instead found where the sigil should be.

TrailingArrow

Trailing arrow (>) is not present.

Fields of TrailingArrow

found: Option<char>

Character that was instead found where the trailing arrow should be.

Trait Implementations

impl<'a> Clone for ParseMentionError<'a>[src]

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

impl Display for ParseMentionError<'_>[src]

impl<'a> Eq for ParseMentionError<'a>[src]

impl Error for ParseMentionError<'_>[src]

impl<'a> PartialEq<ParseMentionError<'a>> for ParseMentionError<'a>[src]

impl<'a> StructuralEq for ParseMentionError<'a>[src]

impl<'a> StructuralPartialEq for ParseMentionError<'a>[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.