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§
Sourcefn create_command(
name: impl Into<String>,
description: impl Into<String>,
) -> CreateCommand
fn create_command( name: impl Into<String>, description: impl Into<String>, ) -> CreateCommand
Create the command.
Sourcefn from_options(options: &[CommandDataOption]) -> Result<Self>
fn from_options(options: &[CommandDataOption]) -> Result<Self>
Extract data from a list of CommandDataOption
s.
§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.