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