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