pub struct UpdateClient { /* private fields */ }Expand description
Checks Tauri-compatible updater JSON and stages only successfully verified artifacts.
Implementations§
Source§impl UpdateClient
impl UpdateClient
pub fn new(current_version: &str, public_key: impl Into<String>) -> Result<Self>
pub fn target(self, target: impl Into<String>) -> Result<Self>
pub fn maximum_download_bytes(self, maximum: u64) -> Result<Self>
Sourcepub fn check(&self, endpoint: &str) -> Result<Option<AvailableUpdate>>
pub fn check(&self, endpoint: &str) -> Result<Option<AvailableUpdate>>
Fetch bounded update metadata and return None when the remote version is not newer.
Sourcepub fn check_with_cancellation(
&self,
endpoint: &str,
cancellation: &UpdateCancellation,
) -> Result<Option<AvailableUpdate>>
pub fn check_with_cancellation( &self, endpoint: &str, cancellation: &UpdateCancellation, ) -> Result<Option<AvailableUpdate>>
Fetch update metadata while cooperatively observing cancellation between I/O reads.
Sourcepub fn parse_manifest(&self, bytes: &[u8]) -> Result<Option<AvailableUpdate>>
pub fn parse_manifest(&self, bytes: &[u8]) -> Result<Option<AvailableUpdate>>
Parse already-fetched metadata using the same bounded, target-aware rules as Self::check.
Sourcepub fn download_and_stage(
&self,
update: &AvailableUpdate,
destination_directory: impl AsRef<Path>,
) -> Result<PathBuf>
pub fn download_and_stage( &self, update: &AvailableUpdate, destination_directory: impl AsRef<Path>, ) -> Result<PathBuf>
Download, stream-verify, fsync, and atomically persist an update artifact.
Sourcepub fn download_and_stage_with_progress(
&self,
update: &AvailableUpdate,
destination_directory: impl AsRef<Path>,
on_progress: impl FnMut(UpdateProgress),
) -> Result<PathBuf>
pub fn download_and_stage_with_progress( &self, update: &AvailableUpdate, destination_directory: impl AsRef<Path>, on_progress: impl FnMut(UpdateProgress), ) -> Result<PathBuf>
Download and stage while reporting bounded byte progress on the calling thread.
Sourcepub fn download_and_stage_with_progress_and_cancellation(
&self,
update: &AvailableUpdate,
destination_directory: impl AsRef<Path>,
on_progress: impl FnMut(UpdateProgress),
cancellation: &UpdateCancellation,
) -> Result<PathBuf>
pub fn download_and_stage_with_progress_and_cancellation( &self, update: &AvailableUpdate, destination_directory: impl AsRef<Path>, on_progress: impl FnMut(UpdateProgress), cancellation: &UpdateCancellation, ) -> Result<PathBuf>
Download and stage with progress plus cooperative cancellation between bounded chunks.
Sourcepub fn verify_file(&self, path: impl AsRef<Path>, signature: &str) -> Result<()>
pub fn verify_file(&self, path: impl AsRef<Path>, signature: &str) -> Result<()>
Verify an existing local artifact using the configured public key and bounded streaming.
pub fn verify_file_with_cancellation( &self, path: impl AsRef<Path>, signature: &str, cancellation: &UpdateCancellation, ) -> Result<()>
Sourcepub fn install_staged(
&self,
update: &AvailableUpdate,
artifact: impl AsRef<Path>,
options: UpdateInstallOptions,
) -> Result<InstalledUpdate>
pub fn install_staged( &self, update: &AvailableUpdate, artifact: impl AsRef<Path>, options: UpdateInstallOptions, ) -> Result<InstalledUpdate>
Re-verify and install a staged artifact using the current platform’s native strategy.
macOS expects a gzip-compressed tar archive containing one .app bundle. Linux accepts a
raw executable or a gzip-compressed tar archive containing one AppImage. Windows launches
an .exe or .msi installer with the configured UI policy. The caller should request an
orderly application relaunch after an applied Unix update, or orderly exit after a Windows
installer is launched.
pub fn install_staged_with_progress( &self, update: &AvailableUpdate, artifact: impl AsRef<Path>, options: UpdateInstallOptions, on_progress: impl FnMut(UpdateProgress), ) -> Result<InstalledUpdate>
Sourcepub fn install_staged_with_progress_and_cancellation(
&self,
update: &AvailableUpdate,
artifact: impl AsRef<Path>,
options: UpdateInstallOptions,
on_progress: impl FnMut(UpdateProgress),
cancellation: &UpdateCancellation,
) -> Result<InstalledUpdate>
pub fn install_staged_with_progress_and_cancellation( &self, update: &AvailableUpdate, artifact: impl AsRef<Path>, options: UpdateInstallOptions, on_progress: impl FnMut(UpdateProgress), cancellation: &UpdateCancellation, ) -> Result<InstalledUpdate>
Re-verify and install while observing cancellation before every reversible phase.
Trait Implementations§
Source§impl Clone for UpdateClient
impl Clone for UpdateClient
Source§fn clone(&self) -> UpdateClient
fn clone(&self) -> UpdateClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more