pub struct UpdateState {
pub latest: Option<String>,
pub installed: bool,
pub installing: bool,
/* private fields */
}Fields§
§latest: Option<String>Newer version available (plain semver, no leading v).
installed: boolA self-update finished this session — restart to load it.
installing: boolImplementations§
Source§impl UpdateState
impl UpdateState
pub fn new() -> Self
Sourcepub fn start_check(&mut self, current: &str)
pub fn start_check(&mut self, current: &str)
Kick off the async latest-version lookup. Throttled launches fall back to the stamp’s cached result so a known update still banners.
Sourcepub fn check_now_and_install(&mut self, current: &str) -> String
pub fn check_now_and_install(&mut self, current: &str) -> String
:update with nothing known yet: force a fresh check (bypasses the
throttle) and install automatically when something newer lands.
Sourcepub fn poll(&mut self) -> Option<String>
pub fn poll(&mut self) -> Option<String>
Drain background results; returns a status message when one lands.
Sourcepub fn start_install(&mut self) -> String
pub fn start_install(&mut self) -> String
:update — replace the running binary with the latest release build.
Trait Implementations§
Source§impl Default for UpdateState
impl Default for UpdateState
Source§fn default() -> UpdateState
fn default() -> UpdateState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Sync for UpdateState
impl Freeze for UpdateState
impl RefUnwindSafe for UpdateState
impl Send for UpdateState
impl Unpin for UpdateState
impl UnsafeUnpin for UpdateState
impl UnwindSafe for UpdateState
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.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