浏览代码

feat(plugin): add app getter on PluginHandle

Lucas Nogueira 2 年之前
父节点
当前提交
12c947632d
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      core/tauri/src/plugin.rs

+ 7 - 0
core/tauri/src/plugin.rs

@@ -77,6 +77,13 @@ pub struct PluginHandle<R: Runtime> {
   handle: AppHandle<R>,
 }
 
+impl<R: Runtime> PluginHandle<R> {
+  /// Returns the application handle.
+  pub fn app(&self) -> &AppHandle<R> {
+    &self.handle
+  }
+}
+
 /// Api exposed to the plugin setup hook.
 #[derive(Clone)]
 #[allow(dead_code)]