Skip to main content

Mountain/IPC/StatusReporter/
mountain_get_service_registry.rs

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