pub struct Release {
pub id: String,
pub changelog: String,
pub version: Version,
pub prerelease: bool,
pub variant: Option<ReleaseVariant>,
}Expand description
A single release published by a Source, along with the
binary (variant) selected for it by the source’s configured asset selection.
Fields§
§id: StringThe release identifier, usually the Git tag it was published under
(e.g. v1.2.3). This is what gets embedded in the temporary file name
and used to construct download URLs.
changelog: StringThe release notes / changelog associated with the release.
version: VersionThe parsed semantic version of the release, used to determine which release is the newest.
prerelease: boolWhether this release is a pre-release (beta/early-access) version.
variant: Option<ReleaseVariant>The release asset selected for this platform, if any. For
GitHubSource this is the asset whose name matches
the configured glob pattern, or None when the release has no matching
asset.
Implementations§
Source§impl Release
impl Release
Sourcepub fn get_variant(&self) -> Option<&ReleaseVariant>
pub fn get_variant(&self) -> Option<&ReleaseVariant>
The variant (asset) selected for this platform, if the release has one.
The source has already resolved this to the asset matching its configured
selection. Use is_some to check whether a release
has a usable binary before offering it as an update.
Sourcepub fn get_latest<'a, I>(releases: I) -> Option<&'a Self>where
I: IntoIterator<Item = &'a Self>,
pub fn get_latest<'a, I>(releases: I) -> Option<&'a Self>where
I: IntoIterator<Item = &'a Self>,
Return the release with the highest version from an
iterator of releases, or None if the iterator is empty.