Enum BotCmdResult

Source
pub enum BotCmdResult {
    Ok(Reaction),
    Unauthorized,
    SyntaxErr,
    ArgMissing(Cow<'static, str>),
    ArgMissing1To1(Cow<'static, str>),
    LibErr(Error),
    UserErrMsg(Cow<'static, str>),
    BotErrMsg(Cow<'static, str>),
}

Variants§

§

Ok(Reaction)

The command was processed successfully. Pass through a Reaction.

§

Unauthorized

A user invoked the command without having sufficient authorization to do so. A reply will be sent informing the user of this.

§

SyntaxErr

A user invoked the command with incorrect syntax. A reply will be sent informing the user of the correct syntax.

§

ArgMissing(Cow<'static, str>)

A user invoked the command without providing a required argument, named by the given string. This is a more specific version of SyntaxErr and should be preferred where applicable.

§

ArgMissing1To1(Cow<'static, str>)

A user invoked the command in one-to-one communication (a.k.a. “query” and “PM”) without providing an argument that is required only in one-to-one communication (such as a channel name, which could normally default to the name of the channel in which the command was used), named by the given string. This is a more specific version of ArgMissing and should be preferred where applicable.

§

LibErr(Error)

Pass through an instance of the framework’s Error type.

§

UserErrMsg(Cow<'static, str>)

A user made some miscellaneous error in invoking the command. The given string will be included in a reply informing the user of their error.

§

BotErrMsg(Cow<'static, str>)

A miscellaneous error that doesn’t seem to be the user’s fault occurred while the bot was processing the command. The given string will be included in a reply informing the user of this.

Trait Implementations§

Source§

impl Debug for BotCmdResult

Source§

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

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

impl From<Reaction> for BotCmdResult

Source§

fn from(r: Reaction) -> Self

Converts to this type from the input type.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.
Source§

impl<T> Erased for T