dioxus_devtools_types/
lib.rs1use dioxus_core::internal::HotReloadTemplateWithLocation;
2use serde::{Deserialize, Serialize};
3use std::path::PathBuf;
4use subsecond_types::JumpTable;
5
6#[non_exhaustive]
8#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
9pub enum DevserverMsg {
10 HotReload(HotReloadMsg),
13
14 HotPatchStart,
16
17 FullReloadStart,
19
20 FullReloadFailed,
22
23 FullReloadCommand,
25
26 Shutdown,
28}
29
30#[non_exhaustive]
34#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
35pub enum ClientMsg {
36 Log {
37 level: String,
38 messages: Vec<String>,
39 },
40}
41
42#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
43pub struct HotReloadMsg {
44 pub templates: Vec<HotReloadTemplateWithLocation>,
45 pub assets: Vec<PathBuf>,
46 pub ms_elapsed: u64,
47 pub jump_table: Option<JumpTable>,
48 pub for_build_id: Option<u64>,
49 pub for_pid: Option<u32>,
50}
51
52impl HotReloadMsg {
53 pub fn is_empty(&self) -> bool {
54 self.templates.is_empty() && self.assets.is_empty() && self.jump_table.is_none()
55 }
56}