MCPcopy Index your code
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 if let Some(window) = self.weak.upgrade() {
393 if source {
394 self.auto_tx
395 .clone()
396 .unwrap()
397 .try_send(Duration::from_secs(1))?;
398 tx.try_send(())?;
399 } else {
400 if window.get_is_auto() {
401 tx.try_send(())?;
402 }
403 window.set_is_auto(false);
404 }
405 }
406
407 Ok(())
408 }
409
410 pub(crate) fn execute_skip(&mut self, tx: Sender<()>, source: bool) -> Result<(), EngineError> {
411 if let Some(window) = self.weak.upgrade() {
412 if source {
413 tx.try_send(())?;
414 } else {
415 if window.get_is_skip() {
416 tx.try_send(())?;
417 }
418 window.set_is_skip(false);
419 }
420 }
421
422 Ok(())
423 }
424
425 pub(crate) fn execute_script(&mut self) -> Result<(), EngineError> {
426 {
427 let scr = self.script.clone();
428 let scr = scr.borrow();
429 if scr.in_clear() {
430 self.delay_channels.as_ref().unwrap().clear_all();
431 } else {
432 self.delay_channels.as_ref().unwrap().skip_all();
433 }
434 }
435
436 let res = {
437 let mut text = self.text.write().unwrap();
438 if text.is_running {
439 text.end();
440 true
441 } else {
442 false
443 }
444 };
445 if res {
446 if let Some(window) = self.weak.upgrade() {
447 if window.get_is_auto() {
448 self.auto_tx
449 .clone()
450 .unwrap()
451 .try_send(Duration::from_secs(2))?;

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