Mountain/IPC/WindServiceHandlers/Commands/GetAll.rs
1#![allow(unused_variables, dead_code, unused_imports)]
2
3//! Wire method: `commands:getAll`.
4//! Returns all registered command IDs from Mountain's CommandRegistry.
5
6use std::sync::Arc;
7
8use serde_json::{Value, json};
9
10use crate::RunTime::ApplicationRunTime::ApplicationRunTime;
11
12pub async fn Fn(RunTime:Arc<ApplicationRunTime>) -> Result<Value, String> {
13 use CommonLibrary::Command::CommandExecutor::CommandExecutor;
14
15 let Commands = RunTime
16 .Environment
17 .GetAllCommands()
18 .await
19 .map_err(|Error| format!("commands:getAll failed: {}", Error))?;
20
21 Ok(json!(Commands))
22}