pub enum HotPatchMsg {
TemplatePatch {
generation: u64,
template_key: u64,
node_path: Vec<u16>,
target_test_id: Option<String>,
row_patch_words: Vec<u32>,
text_updates: Vec<(usize, String)>,
text_replacements: Vec<(String, String)>,
},
DylibReload {
generation: u64,
dylib_path: String,
build_ms: u64,
},
DevStatus {
message: String,
latency_ms: u64,
},
ReloadAck {
generation: u64,
ok: bool,
applied: bool,
applied_ms: u64,
detail: String,
},
ClientHello {
client_kind: String,
bundle_hash: String,
reloaded_generation: u64,
},
}Expand description
Unified 2-tier hot-reload protocol broadcast by nv dev over WebSocket (binary v2
frames, see HotPatchMsg::to_bytes) to Desktop Skia, iOS Simulator/Device, Android
Emulator/Device, and Web clients, and handed to apps through NvDevApi::apply_hot_patch.
There is no JSON form and no CSS attribute string payload.
Variants§
TemplatePatch
Tier 1 (<10ms, zero recompile, works on physical iOS devices & browsers):
Applies a binary nativeview_store::RowPatch and/or targeted text update directly onto matching
NodeStore nodes identified by (template_key, node_path) or target_test_id.
Fields
target_test_id: Option<String>Optional test_id / data-testid / testID fallback targeting a specific element.
DylibReload
Tier 2 (150-400ms, desktop + iOS Simulator + Android): Instructs the host shell to hot-swap the compiled Rust app cdylib while preserving state.
DevStatus
Heartbeat / diagnostic banner sent to the live on-screen HUD.
ReloadAck
Client -> daemon acknowledgement emitted after a TemplatePatch or DylibReload
has been applied (and presented, when a visible surface exists) or failed.
ClientHello
Client -> daemon greeting sent immediately on WebSocket open (including after a Web
Tier-2 location.reload()) so nv dev knows the host type and booted bundle hash.
Implementations§
Source§impl HotPatchMsg
impl HotPatchMsg
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, CodecError>
pub fn to_bytes(&self) -> Result<Vec<u8>, CodecError>
Encodes this hot-patch message into compact binary v2 framing.
Sourcepub fn from_bytes(raw: &[u8]) -> Result<Self, HotPatchDecodeError>
pub fn from_bytes(raw: &[u8]) -> Result<Self, HotPatchDecodeError>
Decodes a compact binary v2 hot-patch frame.