pub struct DynamicUpdateHub { /* private fields */ }Expand description
Shared cross-platform hub orchestrating surgical component-level and page-level dynamic updates.
Implementations§
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<F>(
&self,
id: String,
version: u64,
builder: F,
) -> Result<u64, DynamicUpdateError>
pub fn swap_component_builder<F>( &self, id: String, version: u64, builder: F, ) -> 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.F- 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<F>(
&self,
route: String,
title: String,
version: u64,
builder: F,
) -> Result<u64, DynamicUpdateError>
pub fn swap_page_builder<F>( &self, route: String, title: String, version: u64, builder: F, ) -> 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.F- 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<F>(&self, handler: F)where
F: FnMut(&DynamicActionEvent) + 'static,
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.
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.
Sourcepub fn component_revision_signal(&self, id: &str) -> Signal<u64>
pub fn component_revision_signal(&self, id: &str) -> Signal<u64>
Sourcepub fn page_revision_signal(&self, route: &str) -> Signal<u64>
pub fn page_revision_signal(&self, route: &str) -> Signal<u64>
Sourcepub fn component_version(&self, id: &str) -> u64
pub fn component_version(&self, id: &str) -> u64
Sourcepub fn component_history_len(&self, id: &str) -> usize
pub fn component_history_len(&self, id: &str) -> usize
Sourcepub fn page_version(&self, route: &str) -> u64
pub fn page_version(&self, route: &str) -> u64
Sourcepub fn page_title(&self, route: &str) -> Option<String>
pub fn page_title(&self, route: &str) -> Option<String>
Sourcepub fn has_dynamic_page(&self, route: &str) -> bool
pub fn has_dynamic_page(&self, route: &str) -> bool
Sourcepub fn registered_routes(&self) -> Vec<String>
pub fn registered_routes(&self) -> Vec<String>
Sourcepub fn routes_signal(&self) -> Signal<u64>
pub fn routes_signal(&self) -> Signal<u64>
Sourcepub fn telemetry(&self) -> Signal<DynamicTelemetry>
pub fn telemetry(&self) -> Signal<DynamicTelemetry>
Sourcepub fn last_action(&self) -> Signal<Option<DynamicActionEvent>>
pub fn last_action(&self) -> Signal<Option<DynamicActionEvent>>
Sourcepub fn mount_component_or_fallback(
&self,
id: &str,
fallback: &DynamicBuilderFn,
) -> NodeId
pub fn mount_component_or_fallback( &self, id: &str, fallback: &DynamicBuilderFn, ) -> NodeId
Sourcepub fn mount_page_or_fallback(
&self,
route: &str,
fallback: &DynamicBuilderFn,
) -> NodeId
pub fn mount_page_or_fallback( &self, route: &str, fallback: &DynamicBuilderFn, ) -> NodeId
Trait Implementations§
Source§impl Clone for DynamicUpdateHub
impl Clone for DynamicUpdateHub
Source§impl Debug for DynamicUpdateHub
impl Debug for DynamicUpdateHub
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
impl Move for DynamicUpdateHub
impl Unpin for DynamicUpdateHub
impl UnsafeUnpin for DynamicUpdateHubwhere
*const RcInner<RefCell<DynamicHubState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<DynamicHubState>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more