Skip to main content

Crate ferroui_hot_reload

Crate ferroui_hot_reload 

Source
Expand description

Development reload transactions. All targets and commits remain on the creating UI thread.

Structs§

ComponentReloadTarget
Explicitly opt in for declarative content. Use with_refresh for cached references and application child subscriptions. The original component is never reconstructed. Root assignments can be claimed with the literal, static-resource and binding ownership methods. with_owned_resources and with_owned_styles claim inline Resources and Styles. with_owned_handlers claims routed XAML subscriptions.
ContentReloadTarget
Reloads a classless document inside a stable host. The host and its data context survive. Custom x:Class roots need an application adapter that refreshes their cached references.
ControlStateRestoreContext
Common admission checks for an application’s state-restoration callback.
DocumentContract
Conservative structural contract. Expanded XML names avoid prefix-only false changes.
FileBatch
One stable read of the entire watched set. Includes unchanged documents so a failed/missing dependency can recover without losing edits observed beside it.
FileChange
FileWatcher
HotReloadSession
Sources become authoritative only after every affected live target commits successfully. Session ownership is intentionally !Send: callers must pump it on the UI thread.
InputPause
Disables an input root until dropped, leaving its local value and binding intact. Used during an application’s explicit restart handoff. It does not pause timers, commands invoked programmatically, background work or arbitrary model mutation; the application must quiesce those through its own restart callback/protocol. Applications must not concurrently animate IsEnabled during the handoff.
PanelReloadTarget
Opt-in adapter for framework panels. Only owned children are replaced; application children outside that range retain their identity and ordering. The root namescope must belong to this XAML document. Application children needing names must own separate namescopes. Root assignments and routed handlers require explicit ownership opt-in; constructors are never rerun on the live root.
ReloadManifest
Development manifest emitted by ferroui_build::Build::hot_reload_manifest.
ReloadOutcome
ResourcePreparation
Lazily prepares one resource contribution, shared by all candidate consumers. Register all contributions before resolving any so dependencies are independent of target registration order. Cycles and ambiguous ownership fail preparation.
ResourceReloadTarget
Replaces one explicitly owned merged dictionary, preserving its container, direct application resources and all other merged dictionaries. Register static-resource consumers with this document as a dependency so the session prepares their replacements in the same revision. Dynamic-resource consumers receive the resource provider’s ordinary owner notifications.
RestartHandoff
Holds input and registered application participants paused until dropped. Capture restart state only after begin succeeds. Keep this guard until the old process exits or handoff fails; dropping it resumes participants in reverse registration order, then releases the temporary input contribution.
RestartResume
Resumes one participant when dropped on the UI thread. The closure must not panic, and must restore the participant’s prior running/paused state.
StyleReloadTarget
Replaces one style or nested Styles contribution, retaining its container and application-owned siblings. Native style removal detaches the previous frames; addition invalidates styling for the owner and its logical descendants. Register static-resource consumers as dependencies of this document. Applications caching the replaced style need an explicit refresh adapter.
WatchDirectory
A document directory and its canonical assembly URI prefix (ending in /).
WatchRevision

Enums§

ReloadError
ReloadStatus

Constants§

KEY_NAMESPACE

Traits§

CapturedControlState
State restored only after the complete revision succeeds and layout is updated. Normally runs on the dispatcher; a subsequent reload completes pending state before preparing its candidate. Identity must be unique on both sides and the control’s runtime type must be unchanged. Failed/superseded revisions discard the snapshot without invoking this callback.
ComponentRefresh
Prepares application reference/subscription changes without mutating the live component. Commit runs after content and namescope replacement. Rollback runs after restoring the previous graph; finish runs only after every target commits. Retain old subscriptions until finish, dispose new subscriptions on rollback, and never rerun constructors. As with ReloadTarget, the application must provide reversible, non-panicking cleanup.
ControlStateAdapter
Capture application-specific state from a control before replacement.
PreparedReload
An adapter must keep its prior state until finish. Rollback must also undo a partially failed commit. Preparation must not change the live tree or run irreversible user effects.
ReloadTarget
RestartParticipant
Application-owned work which must stop before restart state is captured. Called on the UI thread. Return only after mutation has stopped; asynchronous draining must finish before this call or return an error for a later retry. On error or panic the participant must undo its own partial work. Previously successful participants are resumed by the handoff. This is not a mechanism for suspending arbitrary threads or rolling back arbitrary user side effects.

Functions§

record_frame_timing
Records accepted-revision timing when FERROUI_RELOAD_TIMINGS=1. Call on the UI thread immediately after applying the revision. The next composition batch includes pending layout/scene updates through MediaContext’s normal render pass; this does not force layout or block the UI thread.