#[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
impl Update
Sourcepub fn update(&self) -> Result<VersionStatus>
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.
Sourcepub fn update_extended(&self) -> Result<ReleaseStatus>
pub fn update_extended(&self) -> Result<ReleaseStatus>
Same as update but returns a ReleaseStatus
with the full release details.
Sourcepub fn get_latest_release(&self) -> Result<Releases>
pub fn get_latest_release(&self) -> Result<Releases>
Fetch the single newest release (raw, unfiltered). See
ReleaseUpdate::get_latest_release.
Sourcepub fn get_newer_releases(&self) -> Result<Releases>
pub fn get_newer_releases(&self) -> Result<Releases>
Fetch the releases newer than the current version. See
ReleaseUpdate::get_newer_releases.
Sourcepub fn get_release_version(&self, ver: &str) -> Result<Release>
pub fn get_release_version(&self, ver: &str) -> Result<Release>
Fetch details of the release matching ver. See
ReleaseUpdate::get_release_version.
Sourcepub fn is_update_available(&self) -> Result<Option<Release>>
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.
impl AsyncReleaseUpdate for Update
Available on crate feature
async only.Source§async fn get_latest_release_async(&self) -> Result<Releases>
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 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 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 + '_
fn update_async( &self, ) -> impl Future<Output = Result<VersionStatus>> + Send + '_
Async sibling of
ReleaseUpdate::update: display release info and update the current
binary to the latest release, returning a VersionStatus. Read moreSource§fn update_extended_async(
&self,
) -> impl Future<Output = Result<ReleaseStatus>> + Send + '_
fn update_extended_async( &self, ) -> impl Future<Output = Result<ReleaseStatus>> + Send + '_
Source§impl ReleaseUpdate for Update
impl ReleaseUpdate for Update
Source§fn get_latest_release(&self) -> Result<Releases>
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>
fn get_newer_releases(&self) -> Result<Releases>
Source§fn get_release_version(&self, ver: &str) -> Result<Release>
fn get_release_version(&self, ver: &str) -> Result<Release>
Fetch details of the release matching the specified version
Source§fn update(&self) -> Result<VersionStatus>
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>
fn update_extended(&self) -> Result<ReleaseStatus>
Same as
update, but returns ReleaseStatus.Source§impl UpdateConfig for Update
impl UpdateConfig for Update
Source§fn 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. Read more
Source§fn current_version(&self) -> &str
fn current_version(&self) -> &str
Current version of binary being updated
Source§fn release_tag(&self) -> Option<&str>
fn release_tag(&self) -> Option<&str>
Release tag optionally specified for the update (set via
release_tag)Source§fn asset_identifier(&self) -> Option<&str>
fn asset_identifier(&self) -> Option<&str>
Optional identifier for determining the asset among multiple matches (set via
asset_identifier)Source§fn bin_install_path(&self) -> &Path
fn bin_install_path(&self) -> &Path
Installation path for the binary being updated
Source§fn bin_path_in_archive(&self) -> &str
fn bin_path_in_archive(&self) -> &str
Path of the binary to be extracted from release package
Source§fn show_download_progress(&self) -> bool
fn show_download_progress(&self) -> bool
Flag indicating if progress information shall be output when downloading a release
Source§fn show_output(&self) -> bool
fn show_output(&self) -> bool
Flag indicating if process informative messages shall be output
Source§fn no_confirm(&self) -> bool
fn no_confirm(&self) -> bool
Flag indicating if the user shouldn’t be prompted to confirm an update
Source§fn progress_template(&self) -> &str
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
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>
fn auth_token(&self) -> Option<&str>
Authorisation token for communicating with backend
Auto Trait Implementations§
impl !RefUnwindSafe for Update
impl !UnwindSafe for Update
impl Freeze for Update
impl Send for Update
impl Sync for Update
impl Unpin for Update
impl UnsafeUnpin for Update
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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