pub trait AppLauncher: Send + Sync {
// Required method
fn launch_app<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_id: &'life1 str,
args: Option<&'life2 [String]>,
) -> Pin<Box<dyn Future<Output = Result<u32, HostApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
应用启动器 trait,定义平台原语。 各平台实现通过平台专属 API 启动应用,插件通过 PluginHandle 委托调用。
Required Methods§
Sourcefn launch_app<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_id: &'life1 str,
args: Option<&'life2 [String]>,
) -> Pin<Box<dyn Future<Output = Result<u32, HostApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn launch_app<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_id: &'life1 str,
args: Option<&'life2 [String]>,
) -> Pin<Box<dyn Future<Output = Result<u32, HostApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
启动应用。 参数:app_id - 应用唯一标识;args - 启动参数(可选)。 返回:成功返回 Ok(pid),失败返回 HostApiError。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".