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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/// Contains definitions for a state machine that contains error handling mechanisms
/// Contains definitions used by a state machine without any error handling support
/// Contains definitions and code for the messaging system
/// Enum used to indicate to the guard function if the transition should transit to the
/// next state or remain in the current one.
/// ```rust
/// # use sfsm_base::non_fallible::{Transition, State};
/// # use sfsm_base::TransitGuard;
/// # struct FooState;
/// # struct BarState;
/// # impl State for FooState {};
/// # impl Into<BarState> for FooState {
/// # fn into(self) -> BarState {
/// # BarState{}
/// # }
/// # }
///
/// # impl Transition<BarState> for FooState {
/// fn guard(&self) -> TransitGuard {
/// let foo = 0;
/// if foo == 0 {
/// TransitGuard::Remain
/// } else {
/// TransitGuard::Transit
/// }
/// }
/// # }
/// ```
/// Implements from<bool> trait for use of use.
/// This allows to transit by returning true. Which simplify the code since it allows to return the
/// TransitGuard from a simple comparison.
/// ```rust
/// # use sfsm_base::non_fallible::{Transition, State};
/// # use sfsm_base::TransitGuard;
/// # struct FooState;
/// # struct BarState;
/// # impl State for FooState {};
/// # impl Into<BarState> for FooState {
/// # fn into(self) -> BarState {
/// # BarState{}
/// # }
/// # }
///
/// # impl Transition<BarState> for FooState {
/// fn guard(&self) -> TransitGuard {
/// let foo = 0;
/// (foo == 0).into() // Returns TransitGuard::Transit
/// }
/// # }
/// ```
/// Contains traits that are used to interact with the state machine but should not be implemented
/// manually. All necessary implementations will be created by the macros.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;