1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Defines whether Taskvisor may start another attempt.
//!
//! The registry resolves this policy from [`TaskSpec`](crate::TaskSpec) and [`TaskDefaults`](crate::TaskDefaults).
//! Taskvisor checks it after each attempt. Most applications select a policy with [`TaskSpec::once`](crate::TaskSpec::once),
//! [`TaskSpec::restartable`](crate::TaskSpec::restartable), or [`TaskSpec::periodic`](crate::TaskSpec::periodic).
//! Use [`TaskSpec::with_restart`](crate::TaskSpec::with_restart) to override that choice.
//!
//! | Policy | After success | After retryable failure |
//! |-------------|-----------------------------|-------------------------|
//! | `Never` | Stop | Stop |
//! | `OnFailure` | Stop | Retry if budget allows |
//! | `Always` | Repeat; use interval if set | Retry if budget allows |
//!
//! Failure timing belongs to [`BackoffPolicy`](crate::BackoffPolicy). The retry limit can stop an otherwise
//! eligible failure retry. It does not limit successful repeats under `Always`. Fatal errors, task cancellation,
//! and runtime cancellation always stop the task.
/// Restart eligibility applied after one task attempt.
///
/// Failure delays and retry limits are separate settings.
/// This enum is non-exhaustive; include a wildcard arm when matching it.