loop driver: Decouple from concrete state

This commit is contained in:
Dorota Czaplejewicz
2022-11-28 15:29:37 +00:00
parent 2f011a57dd
commit e5be92efae
3 changed files with 47 additions and 17 deletions

View File

@ -83,6 +83,10 @@ pub enum Event {
}
impl event_loop::Event for Event {
fn new_timeout_reached(when: Instant) -> Self {
Self::TimeoutReached(when)
}
fn get_timeout_reached(&self) -> Option<Instant> {
match self {
Self::TimeoutReached(when) => Some(*when),