MCPcopy Index your code
hub / github.com/endbasic/endbasic / drain_actions

Method drain_actions

std/src/lib.rs:152–165  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers 1

execMethod · 0.80

Calls 2

clearMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected