Mountain/IPC/StatusReporter/
mountain_discover_services.rs1use tauri::Manager;
6
7use crate::{
8 IPC::StatusReporter::{Reporter::Struct as Reporter, ServiceInfo::Struct as ServiceInfo},
9 dev_log,
10};
11
12#[tauri::command]
13pub async fn mountain_discover_services(app_handle:tauri::AppHandle) -> Result<Vec<ServiceInfo>, String> {
14 dev_log!("lifecycle", "Tauri command: discover_services");
15
16 if let Some(reporter) = app_handle.try_state::<Reporter>() {
17 reporter.discover_services().await
18 } else {
19 Err("StatusReporter not found in application state".to_string())
20 }
21}