Skip to main content

UpdateConfig

Trait UpdateConfig 

Source
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§

Source

fn current_version(&self) -> &str

Current version of binary being updated

Source

fn target(&self) -> &str

Target platform the update is being performed for

Source

fn release_tag(&self) -> Option<&str>

Release tag optionally specified for the update (set via release_tag)

Source

fn bin_name(&self) -> &str

Name of the binary being updated

Source

fn bin_install_path(&self) -> &Path

Installation path for the binary being updated

Source

fn bin_path_in_archive(&self) -> &str

Path of the binary to be extracted from release package

Source

fn show_download_progress(&self) -> bool

Flag indicating if progress information shall be output when downloading a release

Source

fn show_output(&self) -> bool

Flag indicating if process informative messages shall be output

Source

fn no_confirm(&self) -> bool

Flag indicating if the user shouldn’t be prompted to confirm an update

Source

fn progress_template(&self) -> &str

Available on crate feature progress-bar only.

Message template to use if show_download_progress is set (see indicatif::ProgressStyle)

Source

fn progress_chars(&self) -> &str

Available on crate feature progress-bar only.

Progress characters to use if show_download_progress is set (see indicatif::ProgressStyle)

Source

fn auth_token(&self) -> Option<&str>

Authorisation token for communicating with backend

Provided Methods§

Source

fn asset_identifier(&self) -> Option<&str>

Optional identifier for determining the asset among multiple matches (set via asset_identifier)

Source

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§

Source§

impl UpdateConfig for self_update::backends::custom::Update

Source§

impl UpdateConfig for self_update::backends::gitea::Update

Available on crate feature gitea only.
Source§

impl UpdateConfig for self_update::backends::github::Update

Available on crate feature github only.
Source§

impl UpdateConfig for self_update::backends::gitlab::Update

Available on crate feature gitlab only.
Source§

impl UpdateConfig for self_update::backends::s3::Update

Available on crate feature s3 only.
Source§

impl<S> UpdateConfig for AsyncUpdate<S>