Skip to main content

Update

Struct Update 

Source
#[non_exhaustive]
pub struct Update { /* private fields */ }
Available on crate feature github only.
Expand description

Updates to a specified or latest release distributed via GitHub

Implementations§

Source§

impl Update

Source

pub fn configure() -> UpdateBuilder

Initialize a new Update builder

Source§

impl Update

Source

pub fn update(&self) -> Result<VersionStatus>

Display release information and update the current binary to the latest release, pending confirmation. Returns a VersionStatus. See ReleaseUpdate::update.

Source

pub fn update_extended(&self) -> Result<ReleaseStatus>

Same as update but returns a ReleaseStatus with the full release details.

Source

pub fn get_latest_release(&self) -> Result<Releases>

Fetch the single newest release (raw, unfiltered). See ReleaseUpdate::get_latest_release.

Source

pub fn get_newer_releases(&self) -> Result<Releases>

Fetch the releases newer than the current version. See ReleaseUpdate::get_newer_releases.

Source

pub fn get_release_version(&self, ver: &str) -> Result<Release>

Fetch details of the release matching ver. See ReleaseUpdate::get_release_version.

Source

pub fn is_update_available(&self) -> Result<Option<Release>>

Whether a release newer than the current version is available, returning it if so.

A convenience over get_newer_releases: returns the newest strictly-newer Release, or None when already up to date.

Trait Implementations§

Source§

impl AsyncReleaseUpdate for Update

Available on crate feature async only.
Source§

async fn get_latest_release_async(&self) -> Result<Releases>

Async sibling of ReleaseUpdate::get_latest_release: fetch the single newest release as a one-element Releases.
Source§

async fn get_newer_releases_async(&self) -> Result<Releases>

Async sibling of ReleaseUpdate::get_newer_releases: fetch the candidate releases as a Releases (newest-first, filtered to strictly-newer for the built-in backends).
Source§

async fn get_release_version_async(&self, ver: &str) -> Result<Release>

Async sibling of ReleaseUpdate::get_release_version: fetch the release matching ver.
Source§

fn update_async( &self, ) -> impl Future<Output = Result<VersionStatus>> + Send + '_
where Self: Sized + Sync,

Async sibling of ReleaseUpdate::update: display release info and update the current binary to the latest release, returning a VersionStatus. Read more
Source§

fn update_extended_async( &self, ) -> impl Future<Output = Result<ReleaseStatus>> + Send + '_
where Self: Sized + Sync,

Async sibling of ReleaseUpdate::update_extended: same as update_async but returns a ReleaseStatus.
Source§

impl Debug for Update

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ReleaseUpdate for Update

Source§

fn get_latest_release(&self) -> Result<Releases>

Fetch the single newest release from the backend. Read more
Source§

fn get_newer_releases(&self) -> Result<Releases>

Fetch the candidate releases from the backend as a Releases (newest-first, carrying the configured current version). Read more
Source§

fn get_release_version(&self, ver: &str) -> Result<Release>

Fetch details of the release matching the specified version
Source§

fn update(&self) -> Result<VersionStatus>

Display release information and update the current binary to the latest release, pending confirmation from the user. Read more
Source§

fn update_extended(&self) -> Result<ReleaseStatus>

Same as update, but returns ReleaseStatus.
Source§

impl UpdateConfig for Update

Source§

fn api_headers(&self, _auth_token: Option<&str>) -> Result<HeaderMap>

Construct a header with an authorisation entry if an auth token is provided. Read more
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 asset_identifier(&self) -> Option<&str>

Optional identifier for determining the asset among multiple matches (set via asset_identifier)
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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more