pub trait UpdateConfig: Sealed {
Show 14 methods
// Required methods
fn current_version(&self) -> &str;
fn target(&self) -> &str;
fn release_tag(&self) -> Option<&str>;
fn bin_name(&self) -> &str;
fn bin_install_path(&self) -> &Path;
fn bin_path_in_archive(&self) -> &str;
fn show_download_progress(&self) -> bool;
fn show_output(&self) -> bool;
fn no_confirm(&self) -> bool;
fn progress_template(&self) -> &str;
fn progress_chars(&self) -> &str;
fn auth_token(&self) -> Option<&str>;
// Provided methods
fn asset_identifier(&self) -> Option<&str> { ... }
fn api_headers(&self, _auth_token: Option<&str>) -> Result<HeaderMap> { ... }
}Expand description
The shared configuration surface of an updater: the accessors every backend’s Update exposes
(current version, target, bin name/path, progress style, auth, transport, verification hooks,
…).
This trait is sealed: it is implemented only by this crate’s backend Update types and the
custom updaters, and cannot be implemented for types outside the crate. It is the supertrait of
both ReleaseUpdate (sync) and the orchestrator’s async path, so an async-only updater need
not implement the sync fetch methods.
You rarely name this trait directly: accessor calls (e.g. bin_name(), current_version(),
target()) resolve on a dyn ReleaseUpdate value without importing it, and in generic code
bounded R: ReleaseUpdate they are in scope via the supertrait bound (also no import). It is
only needed in scope (use self_update::UpdateConfig;) to call an accessor on a concrete
backend Update value.
Required Methods§
Sourcefn current_version(&self) -> &str
fn current_version(&self) -> &str
Current version of binary being updated
Sourcefn release_tag(&self) -> Option<&str>
fn release_tag(&self) -> Option<&str>
Release tag optionally specified for the update (set via release_tag)
Sourcefn bin_install_path(&self) -> &Path
fn bin_install_path(&self) -> &Path
Installation path for the binary being updated
Sourcefn bin_path_in_archive(&self) -> &str
fn bin_path_in_archive(&self) -> &str
Path of the binary to be extracted from release package
Sourcefn show_download_progress(&self) -> bool
fn show_download_progress(&self) -> bool
Flag indicating if progress information shall be output when downloading a release
Sourcefn show_output(&self) -> bool
fn show_output(&self) -> bool
Flag indicating if process informative messages shall be output
Sourcefn no_confirm(&self) -> bool
fn no_confirm(&self) -> bool
Flag indicating if the user shouldn’t be prompted to confirm an update
Sourcefn progress_template(&self) -> &str
Available on crate feature progress-bar only.
fn progress_template(&self) -> &str
progress-bar only.Message template to use if show_download_progress is set (see indicatif::ProgressStyle)
Sourcefn progress_chars(&self) -> &str
Available on crate feature progress-bar only.
fn progress_chars(&self) -> &str
progress-bar only.Progress characters to use if show_download_progress is set (see indicatif::ProgressStyle)
Sourcefn auth_token(&self) -> Option<&str>
fn auth_token(&self) -> Option<&str>
Authorisation token for communicating with backend
Provided Methods§
Sourcefn asset_identifier(&self) -> Option<&str>
fn asset_identifier(&self) -> Option<&str>
Optional identifier for determining the asset among multiple matches (set via
asset_identifier)
Sourcefn api_headers(&self, _auth_token: Option<&str>) -> Result<HeaderMap>
fn api_headers(&self, _auth_token: Option<&str>) -> Result<HeaderMap>
Construct a header with an authorisation entry if an auth token is provided.
The trait default is a no-op (empty header map): the authorization scheme now lives in the
per-backend RequestConfig and is applied by the
shared header-derivation, not here. Backends that need a custom user-agent / scheme still
override this (github/gitlab/gitea).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl UpdateConfig for self_update::backends::custom::Update
impl UpdateConfig for self_update::backends::gitea::Update
gitea only.impl UpdateConfig for self_update::backends::github::Update
github only.impl UpdateConfig for self_update::backends::gitlab::Update
gitlab only.impl UpdateConfig for self_update::backends::s3::Update
s3 only.