winit/src/platform_impl/web/event_loop/state.rs

27 lines
396 B
Rust
Raw Normal View History

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
#[derive(Debug)]
2019-06-25 03:15:34 +02:00
pub enum State {
Init,
WaitUntil {
timeout: backend::Schedule,
2019-06-25 03:15:34 +02:00
start: Instant,
end: Instant,
},
Wait {
start: Instant,
},
Poll {
request: backend::Schedule,
2019-06-25 03:15:34 +02:00
},
Exit,
}
impl State {
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
}
}