use semver::Version;
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub enum UpdateStatus {
#[default]
Idle,
Checking,
UpToDate,
Available(Version),
Downloading { downloaded: u64, total: Option<u64> },
Installing,
Staged(Version),
Errored(String),
}
impl UpdateStatus {
#[must_use]
pub fn is_busy(&self) -> bool {
matches!(
self,
Self::Checking | Self::Downloading { .. } | Self::Installing
)
}
}