Skip to main content

WasmDynamicManager

Struct WasmDynamicManager 

Source
pub struct WasmDynamicManager { /* private fields */ }
Expand description

Shared cross-platform manager orchestrating partial and global dynamic .wasm download, verification, execution, and native rendering.

Implementations§

Source§

impl WasmDynamicManager

Complete partial & global dynamic .wasm lifecycle orchestration for WasmDynamicManager.

Source

pub fn new( hub: DynamicUpdateHub, fetcher: Rc<dyn WasmFetcher>, config: WasmSandboxConfig, ) -> Self

Creates a WasmDynamicManager bound to hub and fetcher with config.

§Arguments
  • DynamicUpdateHub - Target native scene dynamic update hub.
  • Rc<dyn WasmFetcher> - Transport fetcher for .wasm downloads.
  • WasmSandboxConfig - Sandbox limits and retry/cache configuration.
§Returns
  • Self - Initialized dynamic WASM manager.
Source

pub fn state_signal(&self, scope: &WasmDynamicScope) -> Signal<WasmLoadState>

Returns the reactive WasmLoadState signal for scope.

§Arguments
  • &Self - Manager reference.
  • &WasmDynamicScope - Target partial slot or global scope.
§Returns
  • Signal<WasmLoadState> - Live reactive lifecycle signal.
Source

pub fn global_version_signal(&self) -> Signal<u64>

Returns the reactive global WASM active version signal (0 = built-in native shell).

§Arguments
  • &Self - Manager reference.
§Returns
  • Signal<u64> - Global active version signal.
Source

pub fn telemetry(&self) -> Signal<WasmDynamicTelemetry>

Returns the reactive WasmDynamicTelemetry signal.

§Arguments
  • &Self - Manager reference.
§Returns
  • Signal<WasmDynamicTelemetry> - Cumulative telemetry signal.
Source

pub fn last_logs(&self) -> Signal<Vec<String>>

Returns the reactive signal carrying diagnostic logs from the last executed WASM module.

§Arguments
  • &Self - Manager reference.
§Returns
  • Signal<Vec<String>> - Diagnostic log lines signal.
Source

pub fn cache_len(&self) -> usize

Returns the number of verified cached .wasm entries.

§Arguments
  • &Self - Manager reference.
§Returns
  • usize - Cached module count.
Source

pub fn cancel_scope(&self, scope: &WasmDynamicScope) -> u64

Cancels any active request for scope, advancing its generation ID so stale responses are discarded.

§Arguments
  • &Self - Manager reference.
  • &WasmDynamicScope - Scope to cancel.
§Returns
  • u64 - Newly allocated cancellation generation ID.
Source

pub fn load_and_mount( &self, request: WasmDownloadRequest, signing_key: &str, ) -> Result<u64, WasmDynamicError>

Downloads, verifies, compiles, executes in sandbox, and natively mounts a partial or global .wasm module.

§Arguments
  • &Self - Manager reference.
  • WasmDownloadRequest - Target URL, scope, version, checksum, and signature policy.
  • &str - Signing key used when verifying expected_signature.
§Returns
  • Result<u64, WasmDynamicError> - Mounted version number on success, or typed error (with automatic global LKG rollback).
Source

pub fn dispatch_wasm_event( &self, scope: &WasmDynamicScope, action_code: i32, ) -> Result<i32, WasmDynamicError>

Executes an interactive click/event inside a mounted WASM module (euv_on_event), re-rendering native UI live.

§Arguments
  • &Self - Manager reference.
  • &WasmDynamicScope - Mounted partial or global WASM scope.
  • i32 - Action code passed into euv_on_event.
§Returns
  • Result<i32, WasmDynamicError> - Updated WASM module state value or sandbox error.
Source

pub fn rollback_partial( &self, slot_id: &str, reason: &str, ) -> Result<u64, WasmDynamicError>

Rolls back a partial slot to its previous verified WASM version or compiled native fallback.

§Arguments
  • &Self - Manager reference.
  • &str - Target partial slot ID.
  • &str - Human-readable rollback reason.
§Returns
  • Result<u64, WasmDynamicError> - Active version after rollback (0 = compiled fallback).
Source

pub fn unmount_partial(&self, slot_id: &str)

Unmounts a partial WASM slot completely, freeing its snapshot stack and restoring the compiled native fallback.

§Arguments
  • &Self - Manager reference.
  • &str - Target partial slot ID.
Source

pub fn rollback_global(&self, reason: &str) -> Result<u64, WasmDynamicError>

Rolls back the global full-app WASM shell to the previous LKG snapshot (or built-in native shell when empty).

§Arguments
  • &Self - Manager reference.
  • &str - Rollback reason string.
§Returns
  • Result<u64, WasmDynamicError> - Remaining global version (0 = built-in native shell).
Source

pub fn restore_native_global(&self)

Restores the built-in compiled native application shell, clearing all global WASM overlays cleanly.

§Arguments
  • &Self - Manager reference.

Trait Implementations§

Source§

impl Clone for WasmDynamicManager

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 WasmDynamicManager

Source§

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

Formats the struct fields as a debug struct, skipping excluded fields.

§Arguments
  • &mut std::fmt::Formatter<'_> - The formatter to write the representation into.
§Returns
  • std::fmt::Result - Success or failure of the formatting operation.

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.