pub trait AsyncHandler<T: Send> {
// Required method
fn handle_async<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
args: Vec<String>,
commands: &'life1 HashMap<&'life2 str, Command<T>>,
state: &'life3 mut T,
description: &'life4 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
}
Available on crate feature
async
only.Expand description
Async handler lets you run asynchronous commands. It also requires the shell to be run in asynchronous mode to support it.
Required Methods§
fn handle_async<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
args: Vec<String>,
commands: &'life1 HashMap<&'life2 str, Command<T>>,
state: &'life3 mut T,
description: &'life4 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Implementors§
impl<T: Send> AsyncHandler<T> for DefaultAsyncCLIHandler
Available on crate feature
app
only.