pub fn switch (&mut self, state : Box<dyn State>, message : Option<String>) {
        info!("Switching states");
        match message {
            Some(msg) => {
                debug!("{}", msg);
            },
            _ => {},
        }
        self.pop(Option::None);
        self.push(state, Option::None);
        info!("Switching state")
    }
/// Pops and replaces the state at the top of the stack with a new state.
Pops and replaces the state at the top of the stack with a new state.
Pops and replaces the state at the top of the stack with a new state .
pub fn switch (&mut self, state : Box<dyn State>, message : Option<String>) {
        info!("Switching states");
        match message {
            Some(msg) => {
                debug!("{}", msg);
            },
            _ => {},
        }
        self.pop(Option::None);
        self.push(state, Option::None);
        info!("Switching state")
    }
pub fn switch ( & mut self , state : Box < dyn State > , message : Option < String > ) { info ! ( " " ) ; match message { Some ( msg ) => { debug ! ( " " msg ) ; } , _ => { } , } self . pop ( Option :: None ) ; self . push ( state , Option :: None ) ; info ! ( " " ) }
Pops and replaces the state at the top of the stack with a new state.
Pops and replaces the state at the top of the stack with a new state .
&mut self
state
Box<dyn State>
message
Option<String>
&mut self
state
Box<dyn State>
message
Option<String>