Skip to main content

execute_with

Function execute_with 

Source
pub async fn execute_with<F>(
    exec: impl FnOnce(UnboundedSender<Vec<u8>>) -> F,
    cancel: &CancellationToken,
    on_chunk: impl FnMut(&str),
) -> Result<BashResult, String>
where F: Future<Output = Result<Option<i32>, String>>,
Expand description

pi’s executeBashWithOperations: runs a command through exec, which sends its output to the sender it gets and returns the exit code, and collects the output as execute does. A run that fails or ends after cancel fired is cancelled.