pub fn add_timer(
            &mut self,
            name: &str,
            timer_type: TimerType,
            duration_in_second: f32,
        ) -> Result<&mut Timer, Error> {
            if self.timers.contains_key(name) {
                return Err(Error::TimerAlreadyExists);
            }
            self.timers.insert(name.to_string(), Timer::new(duration_in_second, timer_type));
            Ok(self.timers.get_mut(name).expect("Missing the timer we just inserted..."))
        }
/// Create and adds a timer to the list of known timers
Create and adds a timer to the list of known timers
Create and adds a timer to the list of known timers
pub fn add_timer(
            &mut self,
            name: &str,
            timer_type: TimerType,
            duration_in_second: f32,
        ) -> Result<&mut Timer, Error> {
            if self.timers.contains_key(name) {
                return Err(Error::TimerAlreadyExists);
            }
            self.timers.insert(name.to_string(), Timer::new(duration_in_second, timer_type));
            Ok(self.timers.get_mut(name).expect("Missing the timer we just inserted..."))
        }
pub fn add_timer ( & mut self , name : & str , timer_type : TimerType , duration_in_second : f32 , ) -> Result < & mut Timer , Error > { if self . timers . contains_key ( name ) { return Err ( Error :: TimerAlreadyExists ) ; } self . timers . insert ( name . to_string ( ) , Timer :: new ( duration_in_second , timer_type ) ) ; Ok ( self . timers . get_mut ( name ) . expect ( " " ) ) }
Create and adds a timer to the list of known timers
Create and adds a timer to the list of known timers
&mut self
name
&str
timer_type
TimerType
duration_in_second
f32
&mut self
name
&str
timer_type
TimerType
duration_in_second
f32