pub struct Update { /* private fields */ }Expand description
Wraps a ReleaseUpdate and throttles how often update checks run.
The underlying update check is skipped when one was already performed
within throttle_window. The time of the last check is tracked via a
throttle file in the system temp directory.
§Throttle behavior
The throttle file is touched only after a successful update check. Failed checks do not reset the throttle window, allowing retries without waiting for the full window to elapse.
Implementations§
Source§impl Update
impl Update
Sourcepub fn configure() -> UpdateBuilder
pub fn configure() -> UpdateBuilder
Initialize a new Update builder.
Sourcepub fn throttle_window(&self) -> Duration
pub fn throttle_window(&self) -> Duration
The minimum time that must elapse between update checks.
Trait Implementations§
Source§impl ReleaseUpdate for Update
impl ReleaseUpdate for Update
Source§fn get_latest_release(&self) -> Result<Release>
fn get_latest_release(&self) -> Result<Release>
Fetch details of the latest release from the backend
Source§fn get_latest_releases(&self, current_version: &str) -> Result<Vec<Release>>
fn get_latest_releases(&self, current_version: &str) -> Result<Vec<Release>>
Fetch details of the latest release from the backend
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 current_version(&self) -> String
fn current_version(&self) -> String
Current version of binary being updated
Source§fn target_version(&self) -> Option<String>
fn target_version(&self) -> Option<String>
Target version optionally specified for the update
Source§fn bin_install_path(&self) -> PathBuf
fn bin_install_path(&self) -> PathBuf
Installation path for the binary being updated
Source§fn bin_path_in_archive(&self) -> String
fn bin_path_in_archive(&self) -> String
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
fn progress_template(&self) -> String
fn progress_chars(&self) -> String
Source§fn auth_token(&self) -> Option<String>
fn auth_token(&self) -> Option<String>
Authorisation token for communicating with backend
Source§fn update(&self) -> Result<Status>
fn update(&self) -> Result<Status>
Display release information and update the current binary to the latest release, pending
confirmation from the user
Source§fn update_extended(&self) -> Result<UpdateStatus>
fn update_extended(&self) -> Result<UpdateStatus>
Same as
update, but returns UpdateStatus.Source§fn identifier(&self) -> Option<String>
fn identifier(&self) -> Option<String>
Optional identifier of determining the asset among multiple matches
Auto Trait Implementations§
impl !RefUnwindSafe for Update
impl !Send for Update
impl !Sync for Update
impl !UnwindSafe for Update
impl Freeze 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