浏览代码

Document ipc a bit

Jonathan Kelley 1 年之前
父节点
当前提交
4d95bc1374
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      packages/desktop/src/ipc.rs

+ 7 - 0
packages/desktop/src/ipc.rs

@@ -1,20 +1,27 @@
 use serde::{Deserialize, Serialize};
 use tao::window::WindowId;
 
+/// A pair of data
 #[derive(Debug, Clone)]
 pub struct UserWindowEvent(pub EventData, pub WindowId);
 
+/// The data that might eminate from any window/webview
 #[derive(Debug, Clone)]
 pub enum EventData {
+    /// Poll the virtualdom
     Poll,
 
+    /// Handle an ipc message eminating from the window.postMessage of a given webview
     Ipc(IpcMessage),
 
+    /// Handle a hotreload event, basically telling us to update our templates
     #[cfg(all(feature = "hot-reload", debug_assertions))]
     HotReloadEvent(dioxus_hot_reload::HotReloadMsg),
 
+    /// Create a new window
     NewWindow,
 
+    /// Close a given window (could be any window!)
     CloseWindow,
 }