MCPcopy Create free account
hub / github.com/RustOtomeLab/RustEng / execute_script

Method execute_script

src/executors/executor.rs:394–472  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

392 };
393 script.set_pre_items(jump_index);
394 self.clean_fg("All")?;
395
396 Ok(())
397 }
398
399 pub(crate) fn execute_status(
400 &mut self,
401 status: Status,
402 symbol: bool,
403 ) -> Result<(), EngineError> {
404 let (auto_tx, skip_tx) = self.get_status_channel().unwrap();
405
406 if let Some(window) = self.weak.upgrade() {
407 match status {
408 Status::Auto => {
409 if symbol {
410 window.set_is_auto(false);
411 } else {
412 if window.get_is_skip() {
413 skip_tx.try_send(())?;
414 window.set_is_skip(false);
415 }
416 window.set_is_auto(true);
417 self.auto_tx
418 .clone()
419 .unwrap()
420 .try_send(Duration::from_secs(1))?;
421 }
422 auto_tx.try_send(())?;
423 }
424 Status::Skip => {
425 if !self.can_skip() {
426 return Ok(());
427 }
428
429 if symbol {
430 window.set_is_skip(false);
431 } else {
432 if window.get_is_auto() {
433 auto_tx.try_send(())?;
434 window.set_is_auto(false);
435 }
436 window.set_is_skip(true);
437 }
438 skip_tx.try_send(())?;
439 }
440 Status::Normal => {
441 if window.get_is_auto() {
442 auto_tx.try_send(())?;
443 window.set_is_auto(false);
444 }
445 if window.get_is_skip() {
446 skip_tx.try_send(())?;
447 window.set_is_skip(false);
448 }
449 }
450 }
451 }

Callers 5

start_timerMethod · 0.80
execute_loadMethod · 0.80
execute_stop_videoMethod · 0.80
start_timerMethod · 0.80
uiFunction · 0.80

Calls 6

in_clearMethod · 0.80
clear_allMethod · 0.80
skip_allMethod · 0.80
endMethod · 0.80
next_commandMethod · 0.80
apply_commandMethod · 0.80

Tested by

no test coverage detected