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,
)
| 220 | |
| 221 | /// Runs the EndBASIC CLI depending on the provided `app_mode`. |
| 222 | pub 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 | } |
no test coverage detected