Command

Trait Command 

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

Source

const NAME: &'static str

The name of command

Required Methods§

Source

fn spec() -> CommandSpec

The spec of command for command registration.

Source

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.

Implementors§