pub struct DynamicReleaseRuntime { /* private fields */ }Expand description
Client runtime orchestrator managing per-route pinned dependency graphs, safe swaps, business state, and GC.
Implementations§
Source§impl DynamicReleaseRuntime
Core per-route pinning, safe-point swapping, rollback, and GC orchestration on DynamicReleaseRuntime.
impl DynamicReleaseRuntime
Core per-route pinning, safe-point swapping, rollback, and GC orchestration on DynamicReleaseRuntime.
Sourcepub fn new(
hub: DynamicUpdateHub,
business_store: BusinessStateStore,
sandbox_config: WasmSandboxConfig,
) -> Self
pub fn new( hub: DynamicUpdateHub, business_store: BusinessStateStore, sandbox_config: WasmSandboxConfig, ) -> Self
Creates a new DynamicReleaseRuntime bound to hub and business_store.
§Arguments
DynamicUpdateHub- Live UI dynamic update hub.BusinessStateStore- Host-owned authoritative business state store.WasmSandboxConfig- Sandbox limits applied when mounting dynamic Wasm modules.
§Returns
Self- Initialized dynamic release runtime.
Sourcepub fn business_store(&self) -> &BusinessStateStore
pub fn business_store(&self) -> &BusinessStateStore
Returns a reference to the host-owned BusinessStateStore.
§Returns
&BusinessStateStore- Shared authoritative business state store.
Sourcepub fn active_release_seq(&self) -> u64
pub fn active_release_seq(&self) -> u64
Returns the currently active release sequence number (0 before initial install).
§Returns
u64- Active release sequence.
Sourcepub fn retained_generation_count(&self) -> usize
pub fn retained_generation_count(&self) -> usize
Returns the number of release generations currently retained in memory.
§Returns
usize- Count of retainedReleaseGenerationrecords.
Sourcepub fn has_deferred_candidate(&self) -> bool
pub fn has_deferred_candidate(&self) -> bool
Returns whether a candidate is currently deferred awaiting a safe frame boundary.
§Returns
bool-truewhen a deferred candidate is pending.
Sourcepub fn restored_ui_state(
&self,
canonical_address: &str,
) -> Option<&ComponentUiStateSnapshot>
pub fn restored_ui_state( &self, canonical_address: &str, ) -> Option<&ComponentUiStateSnapshot>
Sourcepub fn install_initial_release(
&mut self,
manifest: ReleaseManifest,
blobs: &BTreeMap<String, Vec<u8>>,
host_abi: u32,
) -> Result<u64, DynamicReleaseError>
pub fn install_initial_release( &mut self, manifest: ReleaseManifest, blobs: &BTreeMap<String, Vec<u8>>, host_abi: u32, ) -> Result<u64, DynamicReleaseError>
Installs an initial built-in or cached signed release generation synchronously at startup.
§Arguments
ReleaseManifest- Verified initial manifest (e.g. generation101).&BTreeMap<String, Vec<u8>>- Raw verified blob bytes keyed by SHA-256 hex digest.u32- Running host ABI version.
§Returns
Result<u64, DynamicReleaseError>- Installed generation sequence number.
Sourcepub fn open_route(
&mut self,
route_instance_id: &str,
route: &str,
) -> Result<RoutePinHandle, DynamicReleaseError>
pub fn open_route( &mut self, route_instance_id: &str, route: &str, ) -> Result<RoutePinHandle, DynamicReleaseError>
Opens a route instance pinned to the currently active release generation and mounts its slots into DynamicUpdateHub.
§Arguments
&str- Stable route instance key (e.g."A#tab-1"or"B#tab-1").&str- Route path (e.g."/route-a"or"/route-b").
§Returns
Result<RoutePinHandle, DynamicReleaseError>- Pinned route handle.
Sourcepub fn close_route(&mut self, route_instance_id: &str) -> usize
pub fn close_route(&mut self, route_instance_id: &str) -> usize
Sourcepub fn pinned_slot_artifact(
&self,
route_instance_id: &str,
slot_key: &str,
) -> Option<String>
pub fn pinned_slot_artifact( &self, route_instance_id: &str, slot_key: &str, ) -> Option<String>
Sourcepub fn pinned_generation_for_route(
&self,
route_instance_id: &str,
) -> Option<u64>
pub fn pinned_generation_for_route( &self, route_instance_id: &str, ) -> Option<u64>
Sourcepub fn capture_nested_snapshot(
&self,
route: &str,
ui_states: BTreeMap<String, ComponentUiStateSnapshot>,
) -> NestedStateSnapshot
pub fn capture_nested_snapshot( &self, route: &str, ui_states: BTreeMap<String, ComponentUiStateSnapshot>, ) -> NestedStateSnapshot
Captures a NestedStateSnapshot at the current authoritative business revision R for route.
§Arguments
&str- Target route path.BTreeMap<String, ComponentUiStateSnapshot>- Live per-instance UI states keyed by canonicalStableAddress.
§Returns
NestedStateSnapshot- Immutable snapshot ready to pass to the background worker.
Sourcepub fn activate_release(
&mut self,
candidate: PreparedReleaseCandidate,
boundary: &InteractionSafePoint,
) -> Result<ActivationReport, DynamicReleaseError>
pub fn activate_release( &mut self, candidate: PreparedReleaseCandidate, boundary: &InteractionSafePoint, ) -> Result<ActivationReport, DynamicReleaseError>
Atomically activates a prepared candidate at a safe frame boundary, swapping ONLY affected routes while keeping unaffected routes pinned (Sec 11.2, 11.4, 11.6, 11.8).
§Arguments
PreparedReleaseCandidate- Candidate prepared off the UI thread.&InteractionSafePoint- Current frame-boundary safety probe.
§Returns
Result<ActivationReport, DynamicReleaseError>- Activation or deferral report.
Sourcepub fn poll_mailbox_and_activate(
&mut self,
worker: &UpdateWorkerHandle,
boundary: &InteractionSafePoint,
) -> Result<Option<ActivationReport>, DynamicReleaseError>
pub fn poll_mailbox_and_activate( &mut self, worker: &UpdateWorkerHandle, boundary: &InteractionSafePoint, ) -> Result<Option<ActivationReport>, DynamicReleaseError>
Non-blockingly polls worker (or a previously deferred candidate) and activates at a safe frame boundary.
§Arguments
&UpdateWorkerHandle- Running background update worker handle.&InteractionSafePoint- Current frame-boundary safety probe.
§Returns
Result<Option<ActivationReport>, DynamicReleaseError>- Report when a candidate was evaluated, orNonewhen idle.
Sourcepub fn dispatch_cross_route_action(
&mut self,
action: &CrossRouteAction,
allowed_actions: &[String],
target_instance_id: &str,
) -> Result<RoutePinHandle, DynamicReleaseError>
pub fn dispatch_cross_route_action( &mut self, action: &CrossRouteAction, allowed_actions: &[String], target_instance_id: &str, ) -> Result<RoutePinHandle, DynamicReleaseError>
Dispatches a host-validated cross-route action, opening the target route pinned to its OWN dependency graph (Sec 11.2).
§Arguments
&CrossRouteAction- Action carrying target route, action ID, origin generation, and cancellation token.&[String]- Permitted host action IDs.&str- Stable instance identifier for the opened target route.
§Returns
Result<RoutePinHandle, DynamicReleaseError>- Target route’s independent pinned handle.
Sourcepub fn gc_unreachable_generations(&mut self) -> usize
pub fn gc_unreachable_generations(&mut self) -> usize
Reclaims old release generations that are no longer active and have zero open route pins or in-flight tasks.
§Returns
usize- Number of reclaimed generations.