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
crate::ix!();
pub enum WaitState {
/**
| Used for announcements that need efficient
| testing of "is their timestamp in the
| future?".
|
*/
FUTURE_EVENT,
/**
| Used for announcements whose timestamp
| is not relevant.
|
*/
NO_EVENT,
/**
| Used for announcements that need efficient
| testing of "is their timestamp in the
| past?".
|
*/
PAST_EVENT,
}
pub fn get_wait_state(ann: &Announcement) -> WaitState {
if ann.is_waiting() {
return WaitState::FUTURE_EVENT;
}
if ann.is_selectable() {
return WaitState::PAST_EVENT;
}
WaitState::NO_EVENT
}