Преглед изворни кода

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)]