pub struct Builder { /* private fields */ }Expand description
Configures the plugin with the GitHub repository whose releases are checked for updates.
Either set Builder::owner and Builder::repo to derive the URLs
from the repository, or provide the URLs explicitly via
Builder::latest_json_url and Builder::releases_url. Missing
configuration is reported when the plugin is set up.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a builder with no URLs configured.
Configure the repository with Builder::owner and Builder::repo,
or provide the URLs explicitly with Builder::latest_json_url and
Builder::releases_url.
Sourcepub fn owner(self, owner: impl Into<String>) -> Self
pub fn owner(self, owner: impl Into<String>) -> Self
Sets the GitHub owner whose releases are checked for updates.
Together with Builder::repo it derives the latest.json manifest
URL and the release page that download_and_install opens.
Sourcepub fn repo(self, repo: impl Into<String>) -> Self
pub fn repo(self, repo: impl Into<String>) -> Self
Sets the GitHub repository whose releases are checked for updates.
Together with Builder::owner it derives the latest.json manifest
URL and the release page that download_and_install opens.
Sourcepub fn latest_json_url(self, url: impl Into<String>) -> Self
pub fn latest_json_url(self, url: impl Into<String>) -> Self
Overrides the URL of the latest.json update manifest that check
reads. Defaults to the manifest attached to the latest release of the
configured repository.
Sourcepub fn releases_url(self, url: impl Into<String>) -> Self
pub fn releases_url(self, url: impl Into<String>) -> Self
Overrides the release page that download_and_install opens.
Defaults to the latest release of the configured repository.
Sourcepub fn build<R: Runtime>(self) -> TauriPlugin<R>
pub fn build<R: Runtime>(self) -> TauriPlugin<R>
Builds the plugin.
Registers the check and download_and_install commands and sets
up the state they rely on. Register it on platforms that cannot
self-install updates (e.g. under #[cfg(mobile)]) and grant the
plugin’s default permission in the app’s capabilities so the
frontend can invoke the commands under their plugin:android-update|
names.
The URLs are resolved when the plugin is set up: an explicitly
configured URL wins, otherwise it is derived from owner/repo.
Plugin setup fails with an error if neither source is configured.