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