pub struct UpdateConfig {
pub channel: ReleaseChannel,
pub pin: Option<VersionPin>,
pub mirrors: MirrorConfig,
pub check_interval_hours: u64,
pub download_timeout_secs: u64,
pub keep_backup: bool,
pub auto_rollback: bool,
}Expand description
Update configuration
Fields§
§channel: ReleaseChannelRelease channel to follow
pin: Option<VersionPin>Pinned version (None = follow channel latest)
mirrors: MirrorConfigMirror configuration
check_interval_hours: u64Auto-update check interval in hours (0 = disable)
download_timeout_secs: u64Download timeout in seconds
keep_backup: boolKeep backup of previous version after update
auto_rollback: boolAuto-rollback on startup if new version fails
Implementations§
Source§impl UpdateConfig
impl UpdateConfig
Sourcepub fn config_path() -> Result<PathBuf>
pub fn config_path() -> Result<PathBuf>
Get the configuration file path
Sourcepub fn pinned_version(&self) -> Option<&Version>
pub fn pinned_version(&self) -> Option<&Version>
Get pinned version if set
Sourcepub fn set_pin(
&mut self,
version: Version,
reason: Option<String>,
auto_unpin: bool,
)
pub fn set_pin( &mut self, version: Version, reason: Option<String>, auto_unpin: bool, )
Set version pin
Sourcepub fn is_check_due(&self, last_check: Option<SystemTime>) -> bool
pub fn is_check_due(&self, last_check: Option<SystemTime>) -> bool
Check if update check is due based on interval
Trait Implementations§
Source§impl Clone for UpdateConfig
impl Clone for UpdateConfig
Source§fn clone(&self) -> UpdateConfig
fn clone(&self) -> UpdateConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UpdateConfig
impl Debug for UpdateConfig
Source§impl Default for UpdateConfig
impl Default for UpdateConfig
Source§impl<'de> Deserialize<'de> for UpdateConfig
impl<'de> Deserialize<'de> for UpdateConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for UpdateConfig
impl RefUnwindSafe for UpdateConfig
impl Send for UpdateConfig
impl Sync for UpdateConfig
impl Unpin for UpdateConfig
impl UnsafeUnpin for UpdateConfig
impl UnwindSafe for UpdateConfig
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