diff --git a/src/timer.rs b/src/timer.rs index 1d5de30..2323be9 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -1,9 +1,11 @@ use crate::integer::{Time,Ratio64}; +#[derive(Clone,Copy,Debug)] pub struct Paused; +#[derive(Clone,Copy,Debug)] pub struct Unpaused; -pub trait PauseState{ +pub trait PauseState:Copy{ const IS_PAUSED:bool; fn new()->Self; } @@ -20,6 +22,7 @@ impl PauseState for Unpaused{ } } +#[derive(Clone,Copy,Debug)] pub struct Realtime{ offset:Time, } @@ -28,6 +31,8 @@ impl Realtime{ Self{offset:Time::ZERO} } } + +#[derive(Clone,Copy,Debug)] pub struct Scaled{ scale:Ratio64, offset:Time, @@ -52,7 +57,7 @@ impl Scaled{ } } -pub trait TimerState{ +pub trait TimerState:Copy{ fn get_time(&self,time:Time)->Time; fn set_time(&mut self,time:Time,new_time:Time); fn get_offset(&self)->Time; @@ -87,6 +92,7 @@ impl TimerState for Scaled{ } } +#[derive(Clone,Copy,Debug)] pub struct TimerFixed{ state:T, _paused:P,