pub trait VirtualCommand: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn execute(
&self,
args: &[String],
ctx: &CommandContext<'_>,
) -> CommandResult;
// Provided method
fn meta(&self) -> Option<&'static CommandMeta> { ... }
}Expand description
Trait for commands that can be registered and executed.
Required Methods§
fn name(&self) -> &str
fn execute(&self, args: &[String], ctx: &CommandContext<'_>) -> CommandResult
Provided Methods§
fn meta(&self) -> Option<&'static CommandMeta>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".