Trait Commands

Source
pub trait Commands: Sized {
    // Required methods
    fn create_commands() -> Vec<CreateCommand>;
    fn from_command_data(data: &CommandData) -> Result<Self>;
}
Expand description

A utility for creating commands and extracting their data from application commands.

Required Methods§

Source

fn create_commands() -> Vec<CreateCommand>

List of top-level commands.

Source

fn from_command_data(data: &CommandData) -> Result<Self>

Extract data from CommandData.

§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§