Trait Command
Source pub trait Command:
Send
+ Sync
+ Debug
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn matches(&self, command: &str) -> bool;
// Provided methods
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn execute_sync(&self, args: &[&str]) -> Result<String> { ... }
fn priority(&self) -> u8 { ... }
fn is_available(&self) -> bool { ... }
}
Converts to this type from the input type.