[][src]Enum twitchchat::MessageError

#[non_exhaustive]pub enum MessageError {
    InvalidCommand {
        expected: String,
        got: String,
    },
    ExpectedNick,
    ExpectedArg {
        pos: usize,
    },
    ExpectedData,
    ExpectedTag {
        name: String,
    },
    CannotParseTag {
        name: String,
        error: Box<dyn Error + Send + Sync>,
    },
    MissingTagKey(usize),
    MissingTagValue(usize),
    IncompleteMessage {
        pos: usize,
    },
    EmptyMessage,
    Custom {
        error: Box<dyn Error + Send + Sync>,
    },
}

An invalid message was either provided, or could not be parsed

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidCommand

Invalid command

Fields of InvalidCommand

expected: String

Expected this command

got: String

But got this command

ExpectedNick

Expected a nickname attached to that message

ExpectedArg

Expected an argument at position pos

Fields of ExpectedArg

pos: usize

'index' of the argument (e.g. 0)

ExpectedData

expected data attached to that message

ExpectedTag

Expected a specific tag

Fields of ExpectedTag

name: String

The tag name

CannotParseTag

Cannot parse a specific tag

Fields of CannotParseTag

name: String

The tag name

error: Box<dyn Error + Send + Sync>

The parse error

MissingTagKey(usize)

An empty key in the tags was provided

MissingTagValue(usize)

A value wasn't provided for a tag pair

This usually means the tag was 'key;' and not 'key=val'. 'key=' is allowed.

IncompleteMessage

An incomplete message was provided

Fields of IncompleteMessage

pos: usize

At index pos

EmptyMessage

An empty message was provided

Custom

A custom error message

Fields of Custom

error: Box<dyn Error + Send + Sync>

The inner error

Trait Implementations

impl Debug for MessageError[src]

impl Display for MessageError[src]

impl Error for MessageError[src]

impl From<MessageError> for Error[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, U> Into<U> for T where
    U: From<T>, 
[src]

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.