pub struct Updater { /* private fields */ }Expand description
The updater for one app build.
Implementations§
Source§impl Updater
impl Updater
Sourcepub fn for_product(
product: &ValidatedProduct,
current_version: &str,
) -> Option<Self>
pub fn for_product( product: &ValidatedProduct, current_version: &str, ) -> Option<Self>
None when the app has no update source, so a caller cannot offer
update controls it could not honour.
Sourcepub fn with_account(self, login: Option<String>) -> Self
pub fn with_account(self, login: Option<String>) -> Self
The GitHub account chosen in Settings for this operation.
pub fn account(&self) -> Option<&str>
pub fn current_version(&self) -> &str
Sourcepub fn check(&self) -> Result<CheckOutcome>
pub fn check(&self) -> Result<CheckOutcome>
Whether a release is newer, current, or has yet to be published.
Sourcepub fn latest(&self) -> Result<Release>
pub fn latest(&self) -> Result<Release>
The newest release in this build’s channel, whether or not it is newer.
Sourcepub fn find(&self, version: &str) -> Result<Release>
pub fn find(&self, version: &str) -> Result<Release>
One exact release by version, including an older one.
Sourcepub fn install(&self, release: &Release) -> Result<Installed>
pub fn install(&self, release: &Release) -> Result<Installed>
Downloads, verifies and installs release over the running
executable. Processes that are already running keep the old version.
Sourcepub fn install_with_progress(
&self,
release: &Release,
progress: impl Fn(UpdateProgress),
) -> Result<Installed>
pub fn install_with_progress( &self, release: &Release, progress: impl Fn(UpdateProgress), ) -> Result<Installed>
Installs with synchronous progress callbacks on the calling thread. Call this from a background thread when updating a user interface.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Updater
impl Freeze for Updater
impl Move for Updater
impl RefUnwindSafe for Updater
impl Send for Updater
impl Sync for Updater
impl Unpin for Updater
impl UnsafeUnpin for Updater
impl UnwindSafe for Updater
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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