pub struct DynamicUpdateHub { /* private fields */ }Expand description
Shared cross-platform hub orchestrating surgical component-level and page-level dynamic updates.
Implementations§
Source§impl DynamicUpdateHub
Atomic release-candidate application and live hot-update worker orchestration on DynamicUpdateHub.
impl DynamicUpdateHub
Atomic release-candidate application and live hot-update worker orchestration on DynamicUpdateHub.
Sourcepub fn apply_prepared_release(
&self,
candidate: &PreparedReleaseCandidate,
) -> Result<usize, DynamicReleaseError>
pub fn apply_prepared_release( &self, candidate: &PreparedReleaseCandidate, ) -> Result<usize, DynamicReleaseError>
Atomically applies all declarative and WASM page/component artifacts from a verified PreparedReleaseCandidate using default sandbox limits.
§Arguments
&Self- Target live dynamic update hub.&PreparedReleaseCandidate- Verified, pre-warmed release candidate fromUpdateWorkerHandle.
§Returns
Result<usize, DynamicReleaseError>- Number of pages and component slots atomically swapped.
Sourcepub fn apply_prepared_release_with_sandbox(
&self,
candidate: &PreparedReleaseCandidate,
sandbox_config: &WasmSandboxConfig,
) -> Result<usize, DynamicReleaseError>
pub fn apply_prepared_release_with_sandbox( &self, candidate: &PreparedReleaseCandidate, sandbox_config: &WasmSandboxConfig, ) -> Result<usize, DynamicReleaseError>
Atomically applies all declarative and WASM page/component artifacts from a verified PreparedReleaseCandidate under sandbox_config.
§Arguments
&Self- Target live dynamic update hub.&PreparedReleaseCandidate- Verified, pre-warmed release candidate.&WasmSandboxConfig- Sandbox fuel and memory limits applied to warmed WASM modules.
§Returns
Result<usize, DynamicReleaseError>- Number of pages and component slots atomically swapped.
Sourcepub fn sync_from_worker(
&self,
worker: &UpdateWorkerHandle,
) -> Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>
pub fn sync_from_worker( &self, worker: &UpdateWorkerHandle, ) -> Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>
Drains the newest verified release candidate from worker without blocking and atomically applies it into DynamicUpdateHub.
§Arguments
&Self- Target live dynamic update hub.&UpdateWorkerHandle- Active background hot-update worker handle.
§Returns
Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>- Applied candidate when a new release was ready, orNone.
Sourcepub fn needs_hot_update_poll(&self) -> bool
pub fn needs_hot_update_poll(&self) -> bool
Returns true when the lock-free hot-update attention flag indicates a queued candidate or state change.
Executes as a single AtomicBool::load with zero RefCell borrows, zero mutex locks, and zero allocations.
§Returns
bool-trueonly whenpoll_hot_updates_at_safe_boundaryhas work to drain.
Sourcepub fn hot_update_status_signal(&self) -> Signal<HotUpdateLiveStatus>
pub fn hot_update_status_signal(&self) -> Signal<HotUpdateLiveStatus>
Sourcepub fn update_hot_update_status(&self, status: HotUpdateLiveStatus)
pub fn update_hot_update_status(&self, status: HotUpdateLiveStatus)
Replaces the published HotUpdateLiveStatus snapshot (used by both native worker polling and wasm32 browser EventSource transport).
§Arguments
&Self- Hub reference.HotUpdateLiveStatus- Updated live status snapshot.
Sourcepub fn is_hot_updates_connected(&self) -> bool
pub fn is_hot_updates_connected(&self) -> bool
Sourcepub fn has_pending_hot_update(&self) -> bool
pub fn has_pending_hot_update(&self) -> bool
Sourcepub fn restore_cached_hot_updates(
&self,
config: &UpdateClientConfig,
) -> Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>
pub fn restore_cached_hot_updates( &self, config: &UpdateClientConfig, ) -> Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>
Restores and atomically applies any verified cached release persisted under config.cache_dir (offline cold-start recovery).
§Arguments
&Self- Target live dynamic update hub.&UpdateClientConfig- Client verification key, ABI, delivery mode, andcache_dir.
§Returns
Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>- Applied cached release when present, orNone.
Sourcepub fn connect_hot_updates(
&self,
config: UpdateClientConfig,
) -> Result<(), DynamicReleaseError>
pub fn connect_hot_updates( &self, config: UpdateClientConfig, ) -> Result<(), DynamicReleaseError>
Starts (or reconnects) the hub-managed background UpdateWorker so App::step_frame() automatically applies incoming verified OTA releases.
§Arguments
&Self- Hub reference.UpdateClientConfig- Server, proxy, verification key, delivery mode, sandbox, and cache settings.
§Returns
Result<(), DynamicReleaseError>-Ok(())when the background worker started cleanly.
Sourcepub fn disconnect_hot_updates(&self)
pub fn disconnect_hot_updates(&self)
Stops any active hub-managed hot-update worker and clears deferred candidates cleanly.
§Arguments
&Self- Hub reference.
Sourcepub fn request_hot_update_reconcile(&self) -> bool
pub fn request_hot_update_reconcile(&self) -> bool
Sourcepub fn poll_hot_updates_at_safe_boundary(
&self,
boundary: &InteractionSafePoint,
) -> Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>
pub fn poll_hot_updates_at_safe_boundary( &self, boundary: &InteractionSafePoint, ) -> Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>
Non-blockingly drains the hub-managed hot-update mailbox (or a previously deferred candidate) and applies it atomically when boundary is safe.
§Arguments
&Self- Hub reference.&InteractionSafePoint- Current frame-boundary safety probe.
§Returns
Result<Option<PreparedReleaseCandidate>, DynamicReleaseError>- Applied candidate when swapped on this frame, orNonewhen idle/deferred.
Source§impl DynamicUpdateHub
Component-level, page-level, and atomic bundle dynamic update orchestration on DynamicUpdateHub.
impl DynamicUpdateHub
Component-level, page-level, and atomic bundle dynamic update orchestration on DynamicUpdateHub.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new DynamicUpdateHub with empty component/page registries and zero telemetry.
§Returns
Self- Shared dynamic update hub handle.
Sourcepub fn apply_component(
&self,
update: DynamicComponentUpdate,
) -> Result<u64, DynamicUpdateError>
pub fn apply_component( &self, update: DynamicComponentUpdate, ) -> Result<u64, DynamicUpdateError>
Sourcepub fn apply_component_json(
&self,
json: &str,
) -> Result<u64, DynamicUpdateError>
pub fn apply_component_json( &self, json: &str, ) -> Result<u64, DynamicUpdateError>
Sourcepub fn swap_component_builder<CallbackFn>(
&self,
id: String,
version: u64,
builder: CallbackFn,
) -> Result<u64, DynamicUpdateError>
pub fn swap_component_builder<CallbackFn>( &self, id: String, version: u64, builder: CallbackFn, ) -> Result<u64, DynamicUpdateError>
Hot-swaps a component slot with a native Rust builder closure without rebuilding sibling UI.
§Arguments
&Self- Hub reference.String- Target component slot ID.u64- Monotonic version number.CallbackFn- Zero-context native Rust UI builder closure.
§Returns
Result<u64, DynamicUpdateError>- Newly active component version on success.
Sourcepub fn rollback_component(&self, id: &str) -> Result<u64, DynamicUpdateError>
pub fn rollback_component(&self, id: &str) -> Result<u64, DynamicUpdateError>
Sourcepub fn apply_page(
&self,
update: DynamicPageUpdate,
) -> Result<u64, DynamicUpdateError>
pub fn apply_page( &self, update: DynamicPageUpdate, ) -> Result<u64, DynamicUpdateError>
Sourcepub fn apply_page_json(&self, json: &str) -> Result<u64, DynamicUpdateError>
pub fn apply_page_json(&self, json: &str) -> Result<u64, DynamicUpdateError>
Sourcepub fn swap_page_builder<CallbackFn>(
&self,
route: String,
title: String,
version: u64,
builder: CallbackFn,
) -> Result<u64, DynamicUpdateError>
pub fn swap_page_builder<CallbackFn>( &self, route: String, title: String, version: u64, builder: CallbackFn, ) -> Result<u64, DynamicUpdateError>
Hot-swaps a page route with a native Rust page builder closure.
§Arguments
&Self- Hub reference.String- Target route path.String- Page title.u64- Monotonic page version number.CallbackFn- Zero-context native Rust page builder closure.
§Returns
Result<u64, DynamicUpdateError>- Newly active page version on success.
Sourcepub fn rollback_page(&self, route: &str) -> Result<u64, DynamicUpdateError>
pub fn rollback_page(&self, route: &str) -> Result<u64, DynamicUpdateError>
Sourcepub fn apply_bundle(
&self,
bundle: DynamicUpdateBundle,
) -> Result<DynamicTelemetry, DynamicUpdateError>
pub fn apply_bundle( &self, bundle: DynamicUpdateBundle, ) -> Result<DynamicTelemetry, DynamicUpdateError>
Validates all component and page entries in bundle before committing them atomically in a single batch.
§Arguments
&Self- Hub reference.DynamicUpdateBundle- Multi-target atomic release bundle.
§Returns
Result<DynamicTelemetry, DynamicUpdateError>- Updated telemetry snapshot on full commit, or error with zero partial mutation.
Sourcepub fn apply_bundle_json(
&self,
json: &str,
) -> Result<DynamicTelemetry, DynamicUpdateError>
pub fn apply_bundle_json( &self, json: &str, ) -> Result<DynamicTelemetry, DynamicUpdateError>
Sourcepub fn on_action<CallbackFn>(&self, handler: CallbackFn)where
CallbackFn: FnMut(&DynamicActionEvent) + 'static,
pub fn on_action<CallbackFn>(&self, handler: CallbackFn)where
CallbackFn: FnMut(&DynamicActionEvent) + 'static,
Registers an action callback invoked whenever a button inside a dynamically updated component or page is clicked.
§Arguments
&Self- Hub reference.CallbackFn- Action callback receiving&DynamicActionEvent.
Sourcepub fn dispatch_action(&self, event: DynamicActionEvent)
pub fn dispatch_action(&self, event: DynamicActionEvent)
Dispatches a DynamicActionEvent to all registered handlers and updates last_action + telemetry.
§Arguments
&Self- Hub reference.DynamicActionEvent- Action event emitted by a dynamic control.