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
use async_trait;
use crate::;
/// Transition from one task to the next
///
/// When a task executes, it can control the transition to the next state in three different ways.
/// First, it can fail by returning `Err`. In this case, the runtime will stop execution and handle
/// the error gracefully. Second, a task can succeed and simply trigger the transition to the next
/// task. Third, a task can indicate that the automaton should finish early. This can be useful if
/// no work needs to be done.
/// Executable task
///
/// Automatons execute a series of tasks. Each task should only perform a single, logical step and
/// then return the next task.
///
/// Tasks can share data with each other by putting it into the shared state.
///
/// If a task determines that no more work needs to be done, it can complete the automaton early by
/// returning a [`Transition`] with the `Complete` variant.