Trait Command

Source
pub trait Command {
    // Required methods
    fn name(&self) -> &str;
    fn execute(&self, args: &[String]);

    // Provided methods
    fn aliases(&self) -> &[&str] { ... }
    fn help(&self) -> Option<&str> { ... }
    fn hidden(&self) -> bool { ... }
    fn validate(&self, _args: &[String]) -> Result<(), String> { ... }
}
Expand description

Defines the trait for commands to implement.

Required Methods§

Source

fn name(&self) -> &str

Source

fn execute(&self, args: &[String])

Provided Methods§

Source

fn aliases(&self) -> &[&str]

Source

fn help(&self) -> Option<&str>

Source

fn hidden(&self) -> bool

Source

fn validate(&self, _args: &[String]) -> Result<(), String>

Implementors§