#[non_exhaustive]pub enum Commands {
Peek,
Roulette,
}Expand description
List of commands. Cheap to clone.
Variants (Non-exhaustive)§
This enum is marked as 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.
Implementations§
Source§impl Commands
impl Commands
Sourcepub fn parse(text: Option<&String>, username: &str) -> Option<Commands>
pub fn parse(text: Option<&String>, username: &str) -> Option<Commands>
Try to parse the given text to a command.
§Arguments
text- The text to check.username- The username of the bot.
Sourcepub async fn execute(
&self,
bot: &Bot,
msg: Message,
roulette: &Mutex<Roulette>,
) -> Option<String>
pub async fn execute( &self, bot: &Bot, msg: Message, roulette: &Mutex<Roulette>, ) -> Option<String>
Execute the command.
Sourcepub fn list() -> Vec<BotCommand>
pub fn list() -> Vec<BotCommand>
List of commands.
Auto Trait Implementations§
impl Freeze for Commands
impl RefUnwindSafe for Commands
impl Send for Commands
impl Sync for Commands
impl Unpin for Commands
impl UnsafeUnpin for Commands
impl UnwindSafe for Commands
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more