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 required_caps(&self) -> &[&str] { ... }
fn validate(&self, _args: &[String]) -> Result<(), ModCliError> { ... }
fn execute_with(&self, args: &[String], _registry: &CommandRegistry) { ... }
}Required Methods§
Provided Methods§
fn aliases(&self) -> &[&str]
fn help(&self) -> Option<&str>
Sourcefn required_caps(&self) -> &[&str]
fn required_caps(&self) -> &[&str]
Capability requirements for visibility/authorization. The parent application grants capabilities at runtime on the registry. Default: no requirements.
fn validate(&self, _args: &[String]) -> Result<(), ModCliError>
Sourcefn execute_with(&self, args: &[String], _registry: &CommandRegistry)
fn execute_with(&self, args: &[String], _registry: &CommandRegistry)
Execute with access to the registry context. Default delegates to execute.
Commands that need registry access (e.g., help) can override this.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".