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

Method start_timer

src/executors/delay_executor.rs:169–192  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

167 }
168
169 pub(crate) fn start_timer(&self) {
170 let executor = self.executor.clone();
171 let command = self.command.clone();
172
173 self.timer.start(
174 slint::TimerMode::Repeated,
175 Duration::from_millis(30),
176 move || {
177 if let Some(mut cmd) = command.write().unwrap().pop_front() {
178 cmd.delete_delay();
179 let result = if let Command::Figure { .. } = &cmd {
180 executor.show_fg(&cmd)
181 } else if let Command::Move { .. } = &cmd {
182 executor.show_move(&cmd)
183 } else {
184 Ok(())
185 };
186 if let Err(e) = result {
187 eprintln!("delay executors failed: {e}");
188 }
189 }
190 },
191 );
192 }
193}

Callers

nothing calls this directly

Calls 3

delete_delayMethod · 0.80
show_fgMethod · 0.80
show_moveMethod · 0.80

Tested by

no test coverage detected