Skip to main content

DynamicReleaseRuntime

Struct DynamicReleaseRuntime 

Source
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.

Source

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.
Source

pub fn business_store(&self) -> &BusinessStateStore

Returns a reference to the host-owned BusinessStateStore.

§Returns
  • &BusinessStateStore - Shared authoritative business state store.
Source

pub fn active_release_seq(&self) -> u64

Returns the currently active release sequence number (0 before initial install).

§Returns
  • u64 - Active release sequence.
Source

pub fn retained_generation_count(&self) -> usize

Returns the number of release generations currently retained in memory.

§Returns
  • usize - Count of retained ReleaseGeneration records.
Source

pub fn has_deferred_candidate(&self) -> bool

Returns whether a candidate is currently deferred awaiting a safe frame boundary.

§Returns
  • bool - true when a deferred candidate is pending.
Source

pub fn restored_ui_state( &self, canonical_address: &str, ) -> Option<&ComponentUiStateSnapshot>

Returns the restored UI state snapshot for a canonical StableAddress, if any.

§Arguments
  • &str - Canonical StableAddress string.
§Returns
  • Option<&ComponentUiStateSnapshot> - Restored UI state snapshot.
Source

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. generation 101).
  • &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.
Source

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.
Source

pub fn close_route(&mut self, route_instance_id: &str) -> usize

Closes an open route instance, cancels its token, decrements its generation pin, and runs GC.

§Arguments
  • &str - Route instance identifier to close.
§Returns
  • usize - Number of unreachable old generations reclaimed by GC.
Source

pub fn pinned_slot_artifact( &self, route_instance_id: &str, slot_key: &str, ) -> Option<String>

Returns the currently pinned artifact key ("card@1.0.0") for slot_key on an open route instance.

§Arguments
  • &str - Open route instance identifier.
  • &str - Logical slot key.
§Returns
  • Option<String> - Exact pinned artifact key if the route and slot exist.
Source

pub fn pinned_generation_for_route( &self, route_instance_id: &str, ) -> Option<u64>

Returns the currently pinned release generation ID for an open route instance.

§Arguments
  • &str - Open route instance identifier.
§Returns
  • Option<u64> - Pinned release generation ID.
Source

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 canonical StableAddress.
§Returns
  • NestedStateSnapshot - Immutable snapshot ready to pass to the background worker.
Source

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.
Source

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, or None when idle.
Source

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.
Source

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.

Trait Implementations§

Source§

impl Debug for DynamicReleaseRuntime

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§

§

impl !RefUnwindSafe for DynamicReleaseRuntime

§

impl !Send for DynamicReleaseRuntime

§

impl !Sync for DynamicReleaseRuntime

§

impl !UnwindSafe for DynamicReleaseRuntime

§

impl Forget for DynamicReleaseRuntime

§

impl Freeze for DynamicReleaseRuntime
where *const RcInner<RefCell<DynamicHubState>> is !null: Freeze, PhantomData<RcInner<RefCell<DynamicHubState>>>: Freeze, *const ArcInner<Mutex<BusinessStateStoreInner>> is !null: Freeze, PhantomData<ArcInner<Mutex<BusinessStateStoreInner>>>: Freeze, *const LeafNode<u64, ReleaseGeneration> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(u64, ReleaseGeneration)>>: Freeze, *const LeafNode<String, RoutePinHandle> is !null: Freeze, PhantomData<Box<(String, RoutePinHandle)>>: Freeze, *const LeafNode<String, ComponentUiStateSnapshot> is !null: Freeze, PhantomData<Box<(String, ComponentUiStateSnapshot)>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const LeafNode<String, BlobArtifact> is !null: Freeze, PhantomData<Box<(String, BlobArtifact)>>: Freeze, *const LeafNode<String, RouteManifest> is !null: Freeze, PhantomData<Box<(String, RouteManifest)>>: Freeze, *const LeafNode<String, WarmedArtifact> is !null: Freeze, PhantomData<Box<(String, WarmedArtifact)>>: Freeze, *const LeafNode<String, u64> is !null: Freeze, PhantomData<Box<(String, u64)>>: Freeze,

§

impl Move for DynamicReleaseRuntime

§

impl Unpin for DynamicReleaseRuntime
where Rc<RefCell<DynamicHubState>>: Unpin, Arc<Mutex<BusinessStateStoreInner>>: Unpin, *const LeafNode<u64, ReleaseGeneration> is !null: Unpin, Box<(u64, ReleaseGeneration)>: Unpin, *const LeafNode<String, RoutePinHandle> is !null: Unpin, Box<(String, RoutePinHandle)>: Unpin, *const LeafNode<String, ComponentUiStateSnapshot> is !null: Unpin, Box<(String, ComponentUiStateSnapshot)>: Unpin, *const u8 is !null: Unpin, *const LeafNode<String, BlobArtifact> is !null: Unpin, Box<(String, BlobArtifact)>: Unpin, *const LeafNode<String, RouteManifest> is !null: Unpin, Box<(String, RouteManifest)>: Unpin, *const LeafNode<String, WarmedArtifact> is !null: Unpin, Box<(String, WarmedArtifact)>: Unpin, *const LeafNode<String, u64> is !null: Unpin, Box<(String, u64)>: Unpin,

§

impl UnsafeUnpin for DynamicReleaseRuntime

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> 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, 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.