Эх сурвалжийг харах

feat(core): impl clone for `Channel` (#7174)

Amr Bashir 2 жил өмнө
parent
commit
b66e7d60f2

+ 5 - 0
.changes/core-channel-clone.md

@@ -0,0 +1,5 @@
+---
+'tauri': 'patch'
+---
+
+Implement `Clone` for `Channel`

+ 9 - 0
core/tauri/src/api/ipc.rs

@@ -26,6 +26,15 @@ pub struct Channel<R: Runtime> {
   window: Window<R>,
 }
 
+impl<R: Runtime> Clone for Channel<R> {
+  fn clone(&self) -> Self {
+    Self {
+      id: self.id,
+      window: self.window.clone(),
+    }
+  }
+}
+
 impl Serialize for Channel {
   fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
   where