Skip to main content

Mountain/IPC/StatusReporter/
mountain_discover_services.rs

1#![allow(non_snake_case)]
2
3//! `mountain_discover_services` Tauri command - run a
4//! one-shot discovery pass and return the populated
5//! `ServiceInfo::Struct` list.
6
7use tauri::Manager;
8
9use crate::{
10	IPC::StatusReporter::{Reporter::Struct as Reporter, ServiceInfo::Struct as ServiceInfo},
11	dev_log,
12};
13
14#[tauri::command]
15pub async fn mountain_discover_services(app_handle:tauri::AppHandle) -> Result<Vec<ServiceInfo>, String> {
16	dev_log!("lifecycle", "Tauri command: discover_services");
17
18	if let Some(reporter) = app_handle.try_state::<Reporter>() {
19		reporter.discover_services().await
20	} else {
21		Err("StatusReporter not found in application state".to_string())
22	}
23}