Skip to main content

dispatch

Function dispatch 

Source
pub async fn dispatch<C, F, Fut>(
    args: &[impl AsRef<str>],
    handler: F,
) -> ExecutionResult
where C: SubCommands, F: FnOnce(C) -> Fut, Fut: Future<Output = Result<String, Error>>,
Expand description

Parses arguments into C and executes handler on the parsed subcommand, returning an ExecutionResult.