pub struct HotUpdate { /* private fields */ }Expand description
Runtime API, managed in the app state by crate::init. IPC commands
(WP4) will be thin wrappers over these methods.
Implementations§
Source§impl HotUpdate
impl HotUpdate
Sourcepub fn notify_app_ready(&self) -> Result<AckOutcome>
pub fn notify_app_ready(&self) -> Result<AckOutcome>
Commit the bundle this process booted (notifyAppReady).
Commits the in-memory booted seq captured at boot resolution — never a value re-read from disk — so a download that finished mid-session stays staged for its own trial boot. Idempotent.
Sourcepub fn current_bundle(&self) -> Result<CurrentBundle>
pub fn current_bundle(&self) -> Result<CurrentBundle>
What is being served right now.
Sourcepub fn reset(&self) -> Result<()>
pub fn reset(&self) -> Result<()>
Debug/support escape hatch: wipe all OTA state and bundles, restart the watermark from the embedded version. The currently served bundle dir (if any) is left in place until the next boot’s GC so the running webview is not torn; serving reverts to embedded on the next launch.
Source§impl HotUpdate
impl HotUpdate
Sourcepub async fn check(&self, config: &UpdateConfig) -> Result<UpdateOutcome>
pub async fn check(&self, config: &UpdateConfig) -> Result<UpdateOutcome>
Fetch and verify the manifest, then report whether it is applicable.
Never downloads the archive. Errors are verification/transport
failures; gate refusals are Ok outcomes.
Sourcepub async fn check_and_download(
&self,
config: &UpdateConfig,
on_progress: impl FnMut(u64, u64) + Send,
) -> Result<UpdateOutcome>
pub async fn check_and_download( &self, config: &UpdateConfig, on_progress: impl FnMut(u64, u64) + Send, ) -> Result<UpdateOutcome>
The full pipeline: check, and if an update is applicable, download, verify, extract, and stage it for the next cold launch.
on_progress(downloaded, total) fires per received archive chunk.
Concurrent calls are serialized; the loser of the race then reports
AlreadyStaged/UpToDate instead of downloading twice.