pub trait Command: Sized {
const NAME: &'static str;
// Required methods
fn spec() -> CommandSpec;
fn parse(
fragments: &[CommandFragment],
) -> Result<Self, CommandParseError<'_>>;
}Expand description
The command
Required Associated Constants§
Required Methods§
Sourcefn spec() -> CommandSpec
fn spec() -> CommandSpec
The spec of command for command registration.
Sourcefn parse(fragments: &[CommandFragment]) -> Result<Self, CommandParseError<'_>>
fn parse(fragments: &[CommandFragment]) -> Result<Self, CommandParseError<'_>>
Try parse command from CommandFragment sequence.
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.