pub async fn collect_and_retry<T, C, D, S>(
    task: T,
    success_condition: C,
    error_condition: D,
    start_value: S,
) -> Result<Vec<T::Item>, T::Error>
where
    T: TaskWithParameter<S>,
    C: SuccessCondition<T::Item, S>,
    D: Condition<T::Error>,
    S: Clone,
{
    RetryPolicy::default()
        .collect_and_retry(task, success_condition, error_condition, start_value)
        .await
}
/// Reruns and collects the results of a `Future`, if successful, with a default `RetryPolicy`
/// under a certain provided success condition. Also retries the `Future`, if
/// not successful under the same policy configuration and the provided error condition.
///
/// ```
/// again::collect_and_retry(
///     |input: u32| async move { Ok::<u32, u32>(input + 1) },
///     |result: &u32| if *result < 2 { Some(*result) } else { None },
///     |err: &u32| *err > 1,
///     0 as u32,
/// );
/// ```
Reruns and collects the results of a `Future`, if successful, with a default `RetryPolicy`
under a certain provided success condition. Also retries the `Future`, if
not successful under the same policy configuration and the provided error condition.


Reruns and collects the results of a ` Future ` if successful with a default ` RetryPolicy ` under a certain provided success condition . Also retries the ` Future ` if not successful under the same policy configuration and the provided error condition .
pub async fn collect_and_retry<T, C, D, S>(
    task: T,
    success_condition: C,
    error_condition: D,
    start_value: S,
) -> Result<Vec<T::Item>, T::Error>
where
    T: TaskWithParameter<S>,
    C: SuccessCondition<T::Item, S>,
    D: Condition<T::Error>,
    S: Clone,
{
    RetryPolicy::default()
        .collect_and_retry(task, success_condition, error_condition, start_value)
        .await
}
pub async fn collect_and_retry < T , C , D , S > ( task : T , success_condition : C , error_condition : D , start_value : S , ) -> Result < Vec < T :: Item > , T :: Error > where T : TaskWithParameter < S > , C : SuccessCondition < T :: Item , S > , D : Condition < T :: Error > , S : Clone , { RetryPolicy :: default ( ) . collect_and_retry ( task , success_condition , error_condition , start_value ) . await }
Reruns and collects the results of a `Future`, if successful, with a default `RetryPolicy`
under a certain provided success condition.
Reruns and collects the results of a ` Future ` if successful with a default ` RetryPolicy ` under a certain provided success condition .
task
T
success_condition
C
error_condition
D
start_value
S
task
T
success_condition
C
error_condition
D
start_value
S