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

@ -45,6 +45,7 @@ use std::time::{ Duration, Instant };
/// Carries the incoming data to affect the actor state,
/// plus an event to help schedule timed events.
pub trait Event: Clone {
fn new_timeout_reached(when: Instant) -> Self;
/// Returns the value of the reached timeout, if this event carries the timeout.
fn get_timeout_reached(&self) -> Option<Instant>;
}