Applies and consumes all deferred actions from the most recent async upcall. Returns whether subsequent execution switched to the stored program due to `RUN`.
(&mut self)
| 150 | /// |
| 151 | /// Returns whether subsequent execution switched to the stored program due to `RUN`. |
| 152 | fn drain_actions(&mut self) -> Result<bool> { |
| 153 | let actions: Vec<MachineAction> = self.actions.borrow_mut().drain(..).collect(); |
| 154 | let mut running_stored_program = false; |
| 155 | for action in actions { |
| 156 | match action { |
| 157 | MachineAction::Clear => self.clear(), |
| 158 | MachineAction::Run(program) => { |
| 159 | self.run(program)?; |
| 160 | running_stored_program = true; |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | Ok(running_stored_program) |
| 165 | } |
| 166 | |
| 167 | /// Consumes any pending signals so they don't affect future executions. |
| 168 | pub fn drain_signals(&mut self) { |