Trait Command

Source
pub trait Command: Sized {
    // Required methods
    fn create_command(
        name: impl Into<String>,
        description: impl Into<String>,
    ) -> CreateCommand;
    fn from_options(options: &[CommandDataOption]) -> Result<Self>;
}
Expand description

A top-level command for use with Commands.

Required Methods§

Source

fn create_command( name: impl Into<String>, description: impl Into<String>, ) -> CreateCommand

Create the command.

Source

fn from_options(options: &[CommandDataOption]) -> Result<Self>

Extract data from a list of CommandDataOptions.

§Errors

Returns an error if the implementation fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§