Skip to main content

HotPatchMsg

Enum HotPatchMsg 

Source
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

§generation: u64
§template_key: u64

Collision-free xxh64 template identity (view! AnchorKey); 0 if unkeyed.

§node_path: Vec<u16>

Structural child-index path inside the template tree (from template root).

§target_test_id: Option<String>

Optional test_id / data-testid / testID fallback targeting a specific element.

§row_patch_words: Vec<u32>

Flat u32 words encoded by nativeview_store::RowPatch::write_words (validated via RowPatchView::from_words and applied directly via Transaction::apply_row_patch).

§text_updates: Vec<(usize, String)>

Positional (text_index, new_text) updates.

§text_replacements: Vec<(String, String)>

Exact (old_text, new_text) static text replacements scoped to the target.

§

DylibReload

Tier 2 (150-400ms, desktop + iOS Simulator + Android): Instructs the host shell to hot-swap the compiled Rust app cdylib while preserving state.

Fields

§generation: u64
§dylib_path: String
§build_ms: u64
§

DevStatus

Heartbeat / diagnostic banner sent to the live on-screen HUD.

Fields

§message: String
§latency_ms: u64
§

ReloadAck

Client -> daemon acknowledgement emitted after a TemplatePatch or DylibReload has been applied (and presented, when a visible surface exists) or failed.

Fields

§generation: u64
§ok: bool
§applied: bool
§applied_ms: u64
§detail: String
§

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.

Fields

§client_kind: String
§bundle_hash: String
§reloaded_generation: u64

Implementations§

Source§

impl HotPatchMsg

Source

pub fn to_bytes(&self) -> Result<Vec<u8>, CodecError>

Encodes this hot-patch message into compact binary v2 framing.

Source

pub fn from_bytes(raw: &[u8]) -> Result<Self, HotPatchDecodeError>

Decodes a compact binary v2 hot-patch frame.

Trait Implementations§

Source§

impl Clone for HotPatchMsg

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HotPatchMsg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for HotPatchMsg

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for HotPatchMsg

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.