From 4d95bc1374d092ac75de7c7bd590c736dcd3e422 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Thu, 4 Jan 2024 20:28:57 -0800 Subject: [PATCH] Document ipc a bit --- packages/desktop/src/ipc.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/desktop/src/ipc.rs b/packages/desktop/src/ipc.rs index 5d939e808..c8810c63a 100644 --- a/packages/desktop/src/ipc.rs +++ b/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, }