pub trait AsyncCommandHandler:
Send
+ Sync
+ 'static {
// Required methods
fn execute_async<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
app: &'life1 mut TerminalApp,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn box_clone(&self) -> Box<dyn AsyncCommandHandler>;
}Expand description
Trait for asynchronous command handlers that can be registered with the terminal application.
All asynchronous commands must implement this trait to be executable within the terminal app. Handlers receive mutable access to the application state and command arguments.
Required Methods§
Sourcefn execute_async<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
app: &'life1 mut TerminalApp,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute_async<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
app: &'life1 mut TerminalApp,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sourcefn box_clone(&self) -> Box<dyn AsyncCommandHandler>
fn box_clone(&self) -> Box<dyn AsyncCommandHandler>
Creates a boxed clone of this handler for reuse