Skip to main content

DynamicUpdateHub

Struct DynamicUpdateHub 

Source
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 bridge connecting UpdateWorkerHandle directly to DynamicUpdateHub.

Source

pub fn apply_prepared_release( &self, candidate: &PreparedReleaseCandidate, ) -> Result<usize, DynamicReleaseError>

Atomically applies all declarative page and component artifacts from a verified PreparedReleaseCandidate into DynamicUpdateHub.

§Arguments
  • &Self - Target live dynamic update hub.
  • &PreparedReleaseCandidate - Verified, pre-warmed release candidate from UpdateWorkerHandle.
§Returns
  • Result<usize, DynamicReleaseError> - Number of declarative pages and component slots atomically swapped.
Source

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

impl DynamicUpdateHub

Component-level, page-level, and atomic bundle dynamic update orchestration on DynamicUpdateHub.

Source

pub fn new() -> Self

Creates a new DynamicUpdateHub with empty component/page registries and zero telemetry.

§Returns
  • Self - Shared dynamic update hub handle.
Source

pub fn apply_component( &self, update: DynamicComponentUpdate, ) -> Result<u64, DynamicUpdateError>

Applies a validated component-level dynamic update and surgically re-renders only that component slot.

§Arguments
  • &Self - Hub reference.
  • DynamicComponentUpdate - Incoming versioned component update.
§Returns
  • Result<u64, DynamicUpdateError> - Newly active component version on success.
Source

pub fn apply_component_json( &self, json: &str, ) -> Result<u64, DynamicUpdateError>

Parses and applies a JSON-encoded component-level dynamic update manifest.

§Arguments
  • &Self - Hub reference.
  • &str - JSON string encoding a DynamicComponentUpdate.
§Returns
  • Result<u64, DynamicUpdateError> - Newly active component version on success.
Source

pub fn swap_component_builder<F>( &self, id: String, version: u64, builder: F, ) -> Result<u64, DynamicUpdateError>
where F: Fn() -> NodeId + 'static,

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.
  • F - Zero-context native Rust UI builder closure.
§Returns
  • Result<u64, DynamicUpdateError> - Newly active component version on success.
Source

pub fn rollback_component(&self, id: &str) -> Result<u64, DynamicUpdateError>

Rolls back a component slot to its previous revision (or 0 compiled fallback when the stack empties).

§Arguments
  • &Self - Hub reference.
  • &str - Target component slot ID.
§Returns
  • Result<u64, DynamicUpdateError> - Restored active version (0 means compiled fallback).
Source

pub fn apply_page( &self, update: DynamicPageUpdate, ) -> Result<u64, DynamicUpdateError>

Applies a validated page-level dynamic update (overriding an existing route or injecting a new one).

§Arguments
  • &Self - Hub reference.
  • DynamicPageUpdate - Incoming versioned page update.
§Returns
  • Result<u64, DynamicUpdateError> - Newly active page version on success.
Source

pub fn apply_page_json(&self, json: &str) -> Result<u64, DynamicUpdateError>

Parses and applies a JSON-encoded page-level dynamic update manifest.

§Arguments
  • &Self - Hub reference.
  • &str - JSON string encoding a DynamicPageUpdate.
§Returns
  • Result<u64, DynamicUpdateError> - Newly active page version on success.
Source

pub fn swap_page_builder<F>( &self, route: String, title: String, version: u64, builder: F, ) -> Result<u64, DynamicUpdateError>
where F: Fn() -> NodeId + 'static,

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.
  • F - Zero-context native Rust page builder closure.
§Returns
  • Result<u64, DynamicUpdateError> - Newly active page version on success.
Source

pub fn rollback_page(&self, route: &str) -> Result<u64, DynamicUpdateError>

Rolls back a dynamically updated page to its previous revision (or 0 compiled fallback).

§Arguments
  • &Self - Hub reference.
  • &str - Target route path.
§Returns
  • Result<u64, DynamicUpdateError> - Restored page version (0 means fallback / removed).
Source

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

pub fn apply_bundle_json( &self, json: &str, ) -> Result<DynamicTelemetry, DynamicUpdateError>

Parses and atomically applies a JSON-encoded DynamicUpdateBundle manifest.

§Arguments
  • &Self - Hub reference.
  • &str - JSON bundle manifest string.
§Returns
  • Result<DynamicTelemetry, DynamicUpdateError> - Updated telemetry snapshot on success.
Source

pub fn on_action<F>(&self, handler: F)
where F: FnMut(&DynamicActionEvent) + 'static,

Registers an action callback invoked whenever a button inside a dynamically updated component or page is clicked.

§Arguments
  • &Self - Hub reference.
  • F - Action callback receiving &DynamicActionEvent.
Source

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

pub fn component_revision_signal(&self, id: &str) -> Signal<u64>

Returns the dedicated reactive revision signal for component slot id.

§Arguments
  • &Self - Hub reference.
  • &str - Component slot identifier.
§Returns
  • Signal<u64> - Surgical revision signal bumped only when id updates.
Source

pub fn page_revision_signal(&self, route: &str) -> Signal<u64>

Returns the dedicated reactive revision signal for page route.

§Arguments
  • &Self - Hub reference.
  • &str - Target route path.
§Returns
  • Signal<u64> - Surgical revision signal bumped only when route updates.
Source

pub fn component_version(&self, id: &str) -> u64

Returns the currently active dynamic version for component slot id (0 means compiled fallback).

§Arguments
  • &Self - Hub reference.
  • &str - Component slot identifier.
§Returns
  • u64 - Active component version.
Source

pub fn component_history_len(&self, id: &str) -> usize

Returns the number of stacked dynamic revisions retained for component slot id.

§Arguments
  • &Self - Hub reference.
  • &str - Component slot identifier.
§Returns
  • usize - Number of revisions on the rollback stack.
Source

pub fn page_version(&self, route: &str) -> u64

Returns the currently active dynamic version for page route (0 means compiled fallback).

§Arguments
  • &Self - Hub reference.
  • &str - Page route path.
§Returns
  • u64 - Active page version.
Source

pub fn page_title(&self, route: &str) -> Option<String>

Returns the active dynamic page title for route if a dynamic page is mounted for it.

§Arguments
  • &Self - Hub reference.
  • &str - Page route path.
§Returns
  • Option<String> - Active dynamic page title if any.
Source

pub fn has_dynamic_page(&self, route: &str) -> bool

Returns true when route currently has an active dynamic page override or injected page.

§Arguments
  • &Self - Hub reference.
  • &str - Page route path.
§Returns
  • bool - True when a dynamic page payload is active for route.
Source

pub fn registered_routes(&self) -> Vec<String>

Returns the sorted list of all routes currently carrying active dynamic page payloads.

§Arguments
  • &Self - Hub reference.
§Returns
  • Vec<String> - Sorted active dynamic route paths.
Source

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

Returns the reactive signal bumped whenever dynamic routes are added or removed.

§Arguments
  • &Self - Hub reference.
§Returns
  • Signal<u64> - Reactive route-set revision signal.
Source

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

Returns the reactive telemetry snapshot signal.

§Arguments
  • &Self - Hub reference.
§Returns
  • Signal<DynamicTelemetry> - Reactive dynamic update telemetry signal.
Source

pub fn last_action(&self) -> Signal<Option<DynamicActionEvent>>

Returns the reactive signal storing the most recently dispatched DynamicActionEvent.

§Arguments
  • &Self - Hub reference.
§Returns
  • Signal<Option<DynamicActionEvent>> - Reactive latest action signal.
Source

pub fn mount_component_or_fallback( &self, id: &str, fb: &Rc<dyn Fn() -> NodeId>, ) -> NodeId

Mounts the active dynamic payload for component slot id, or executes fallback if none is active.

§Arguments
  • &Self - Hub reference.
  • &str - Component slot identifier.
  • &Rc<dyn Fn() -> NodeId> - Compiled fallback builder closure.
§Returns
  • NodeId - Mounted native scene node handle.
Source

pub fn mount_page_or_fallback( &self, route: &str, fallback: &Rc<dyn Fn() -> NodeId>, ) -> NodeId

Mounts the active dynamic payload for page route, or executes fallback if none is active.

§Arguments
  • &Self - Hub reference.
  • &str - Target route path.
  • &Rc<dyn Fn() -> NodeId> - Compiled fallback page builder closure.
§Returns
  • NodeId - Mounted native page node handle.

Trait Implementations§

Source§

impl Clone for DynamicUpdateHub

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 DynamicUpdateHub

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

impl Default for DynamicUpdateHub

Default empty DynamicUpdateHub.

Source§

fn default() -> Self

Creates an empty DynamicUpdateHub backed by fresh reactive signals.

§Returns
  • Self - Initialized hub.

Auto Trait Implementations§

§

impl !RefUnwindSafe for DynamicUpdateHub

§

impl !Send for DynamicUpdateHub

§

impl !Sync for DynamicUpdateHub

§

impl !UnwindSafe for DynamicUpdateHub

§

impl Forget for DynamicUpdateHub

§

impl Freeze for DynamicUpdateHub
where *const RcInner<RefCell<DynamicHubState>> is !null: Freeze, PhantomData<RcInner<RefCell<DynamicHubState>>>: Freeze,

§

impl Move for DynamicUpdateHub

§

impl Unpin for DynamicUpdateHub
where Rc<RefCell<DynamicHubState>>: Unpin,

§

impl UnsafeUnpin for DynamicUpdateHub
where *const RcInner<RefCell<DynamicHubState>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<DynamicHubState>>>: UnsafeUnpin,

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.