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

Function async_app_main

cli/src/lib.rs:222–251  ·  view source on GitHub ↗

Runs the EndBASIC CLI depending on the provided `app_mode`.

(
    app_mode: AppMode,
    console_factory: Box<dyn ConsoleFactory>,
    signals_chan: (Sender<Signal>, Receiver<Signal>),
    gpio_pins_spec: Option<String>,
    service_url: String,
)

Source from the content-addressed store, hash-verified

220
221/// Runs the EndBASIC CLI depending on the provided `app_mode`.
222pub async fn async_app_main(
223 app_mode: AppMode,
224 console_factory: Box<dyn ConsoleFactory>,
225 signals_chan: (Sender<Signal>, Receiver<Signal>),
226 gpio_pins_spec: Option<String>,
227 service_url: String,
228) -> Result<i32> {
229 match app_mode {
230 AppMode::Repl(local_drive) => Ok(run_repl_loop(
231 console_factory,
232 signals_chan,
233 gpio_pins_spec.as_deref(),
234 &local_drive,
235 &service_url,
236 )
237 .await?),
238 AppMode::RunInteractive(file, local_drive) => Ok(run_interactive(
239 &file,
240 console_factory,
241 signals_chan,
242 gpio_pins_spec.as_deref(),
243 &local_drive,
244 &service_url,
245 )
246 .await?),
247 AppMode::RunScript(file) => {
248 Ok(run_script(file, console_factory, signals_chan, gpio_pins_spec.as_deref()).await?)
249 }
250 }
251}

Callers 1

app_mainFunction · 0.85

Calls 3

run_interactiveFunction · 0.85
run_scriptFunction · 0.85
run_repl_loopFunction · 0.70

Tested by

no test coverage detected