pub struct UpdateConfig {
pub channel: ReleaseChannel,
pub pin: Option<VersionPin>,
pub check_interval_hours: u64,
pub download_timeout_secs: u64,
}Expand description
Update configuration
Fields§
§channel: ReleaseChannelRelease channel to follow
pin: Option<VersionPin>Pinned version (None = follow channel latest)
check_interval_hours: u64Auto-update check interval in hours (0 = disable)
download_timeout_secs: u64Download timeout in seconds
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 should_auto_unpin(&self) -> bool
pub fn should_auto_unpin(&self) -> bool
Whether the current pin should be automatically removed when a newer
release is available. Returns false when not pinned or when
auto_unpin was not set.
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§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