zerolaunch_plugin_api/services/app/app_launcher.rs
1use crate::host::error::HostApiError;
2use async_trait::async_trait;
3
4/// 应用启动器 trait,定义平台原语。
5/// 各平台实现通过平台专属 API 启动应用,插件通过 PluginHandle 委托调用。
6#[async_trait]
7pub trait AppLauncher: Send + Sync {
8 /// 启动应用。
9 /// 参数:app_id - 应用唯一标识;args - 启动参数(可选)。
10 /// 返回:成功返回 Ok(pid),失败返回 HostApiError。
11 async fn launch_app(&self, app_id: &str, args: Option<&[String]>) -> Result<u32, HostApiError>;
12}