nope, run needs timers with typestate
This commit is contained in:
parent
4247c2ef5a
commit
912ec33dbc
11
src/run.rs
11
src/run.rs
@ -7,7 +7,6 @@ pub enum InvalidationReason{
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error{
|
||||
Timer(TimerError),
|
||||
AlreadyStarted,
|
||||
NotStarted,
|
||||
AlreadyFinished,
|
||||
@ -19,12 +18,16 @@ impl std::fmt::Display for Error{
|
||||
}
|
||||
impl std::error::Error for Error{}
|
||||
|
||||
enum RunState{
|
||||
Created{timer:Timer<Paused>},
|
||||
Started{timer:Timer<Unpaused>},
|
||||
Finished{timer:Timer<Paused>},
|
||||
}
|
||||
|
||||
pub struct Run{
|
||||
timer:Timer<Scaled>,
|
||||
invalidated:Option<InvalidationReason>,
|
||||
created:Time,
|
||||
started:Option<Time>,
|
||||
finished:Option<Time>,
|
||||
state:RunState,
|
||||
}
|
||||
|
||||
impl Run{
|
||||
|
Loading…
Reference in New Issue
Block a user