pub struct UpdateBuilder<R: Runtime> { /* private fields */ }
This is supported on crate feature updater only.
Expand description

An update check builder.

Implementations

Do not use the event system to emit information or listen to install the update.

Set the target name. Represents the string that is looked up on the updater API or response JSON.

Sets a closure that is invoked to compare the current version and the latest version returned by the updater server. The first argument is the current version, and the second one is the latest version.

The closure must return true if the update should be installed.

Examples
  • Always install the version returned by the server:
tauri::Builder::default()
  .setup(|app| {
    tauri::updater::builder(app.handle()).should_install(|_current, _latest| true);
    Ok(())
  });

Check if an update is available.

Examples
tauri::Builder::default()
  .setup(|app| {
    let handle = app.handle();
    tauri::async_runtime::spawn(async move {
      match tauri::updater::builder(handle).check().await {
        Ok(update) => {}
        Err(error) => {}
      }
    });
    Ok(())
  });

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.