2019-06-25 03:15:34 +02:00
|
|
|
use super::backend;
|
|
|
|
|
|
2023-06-01 17:22:28 +02:00
|
|
|
use web_time::Instant;
|
2019-06-25 03:15:34 +02:00
|
|
|
|
2019-06-25 18:07:47 +02:00
|
|
|
#[derive(Debug)]
|
2019-06-25 03:15:34 +02:00
|
|
|
pub enum State {
|
|
|
|
|
Init,
|
2024-03-27 01:20:21 -07:00
|
|
|
WaitUntil { _timeout: backend::Schedule, start: Instant, end: Instant },
|
2019-06-25 03:15:34 +02:00
|
|
|
Wait { start: Instant },
|
2024-03-27 01:20:21 -07:00
|
|
|
Poll { _request: backend::Schedule },
|
2019-06-25 03:15:34 +02:00
|
|
|
Exit,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl State {
|
2023-09-07 08:25:04 +02:00
|
|
|
pub fn exiting(&self) -> bool {
|
2022-06-10 13:43:33 +03:00
|
|
|
matches!(self, State::Exit)
|
2019-06-25 03:15:34 +02:00
|
|
|
}
|
|
|
|
|
}
|