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
use crate::{TimerFsmSettings, lib::*};
use crate::{EventContext, FsmBackend};
use super::{FsmQueueMock, event::FsmEventBuilderState};
pub struct FsmStateBuilder<TFsm, TContext, TState> {
pub (crate) _state: PhantomData<TState>,
pub (crate) _fsm: PhantomData<TFsm>,
pub (crate) _context: PhantomData<TContext>
}
impl<TFsm, TContext, TState> FsmStateBuilder<TFsm, TContext, TState>
where TFsm: FsmBackend
{
pub fn on_entry<'a, TAction: Fn(&mut TState, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(&self, _action: TAction) -> &Self {
self
}
pub fn on_exit<'a, TAction: Fn(&mut TState, &mut EventContext<'a, TFsm, FsmQueueMock<TFsm>>)>(&self, _action: TAction) -> &Self {
self
}
pub fn on_event<TEvent>(&self) -> FsmEventBuilderState<TFsm, TContext, TEvent, TState> {
FsmEventBuilderState {
_state_builder: self,
_event: PhantomData::default()
}
}
pub fn on_entry_start_timer<FSetup, FTrigger>(&self, _setup: FSetup, _trigger: FTrigger) -> FsmStateTimerBuilder<TFsm, TContext, TState>
where
FSetup: Fn(&mut TContext, &mut TimerFsmSettings),
FTrigger: Fn(&TContext, &TState) -> Option< <TFsm as FsmBackend>::Events >
{
FsmStateTimerBuilder {
_state: self
}
}
}
pub struct FsmStateTimerBuilder<'a, TFsm, TContext, TState> {
_state: &'a FsmStateBuilder<TFsm, TContext, TState>
}
impl<'a, TFsm, TContext, TState> FsmStateTimerBuilder<'a, TFsm, TContext, TState>
where TFsm: FsmBackend
{
pub fn with_timer_ty<TTimer>(self) {
}
}