Skip to main content

Mountain/IPC/StatusReporter/
mountain_get_service_registry.rs

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