pub fn overwrite_push(&mut self, state: T) -> Result<(), StateError> {
        if self.stack.last().unwrap() == &state {
            return Err(StateError::AlreadyInState);
        }

        self.scheduled = Some(ScheduledOperation::Push(state));
        Ok(())
    }
/// Same as [Self::push], but if there is already a next state, it will be overwritten
/// instead of failing
Same as [Self::push], but if there is already a next state, it will be overwritten
instead of failing
Same as [ Self :: push ] but if there is already a next state it will be overwritten instead of failing
pub fn overwrite_push(&mut self, state: T) -> Result<(), StateError> {
        if self.stack.last().unwrap() == &state {
            return Err(StateError::AlreadyInState);
        }
        self.scheduled = Some(ScheduledOperation::Push(state));
        Ok(())
    }
pub fn overwrite_push ( & mut self , state : T ) -> Result < ( ) , StateError > { if self . stack . last ( ) . unwrap ( ) == & state { return Err ( StateError :: AlreadyInState ) ; } self . scheduled = Some ( ScheduledOperation :: Push ( state ) ) ; Ok ( ( ) ) }
Same as [Self::push], but if there is already a next state, it will be overwritten
instead of failing
Same as [ Self :: push ] but if there is already a next state it will be overwritten instead of failing
&mut self
state
T
&mut self
state
T