From db4ba34a425793a24a3ef83a6d562330ce30cfe0 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 31 Jul 2024 13:18:53 -0700 Subject: [PATCH] nope, run needs timers with typestate --- src/run.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/run.rs b/src/run.rs index 7d0a187..76d5897 100644 --- a/src/run.rs +++ b/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}, + Started{timer:Timer}, + Finished{timer:Timer}, +} + pub struct Run{ - timer:Timer, invalidated:Option, created:Time, - started:Option