Function join_all_partition_results

Source
pub async fn join_all_partition_results<F, T, E>(
    futures: impl IntoIterator<Item = F>,
) -> (Vec<T>, Option<String>)
where F: Future<Output = Result<T, E>>, E: Display,
Expand description

Executes a collection of fallible futures concurrently and partitions results into successes and errors.

Unlike try_join_all_combine_errors, this function does not fail on errors. Instead, it runs all futures concurrently using [futures::future::join_all] and partitions the results:

  • Successful results are collected into a Vec<T>
  • Errors are collected and combined into an optional error string

This is useful when you want to collect partial successes even if some futures fail, allowing the caller to decide how to handle the mixed results.

ยงReturns

Returns a tuple (Vec<T>, Option<String>) where:

  • The first element contains all successful results
  • The second element is Some(combined_error_string) if any errors occurred, or None if all succeeded