pub struct BuildVersion { /* private fields */ }Expand description
A parsed release version combining semantic version, build number, and development-build provenance.
Two BuildVersion values are only meaningfully comparable when
both originate from the same build source (both CI or both dev).
When the semver components are equal but the build sources differ,
UpgradeDecision::DevBuild is returned instead of a numeric
build-number comparison.
Implementations§
Source§impl BuildVersion
impl BuildVersion
Sourcepub fn new(semver: Version, build_number: u64, dev_build: bool) -> Self
pub fn new(semver: Version, build_number: u64, dev_build: bool) -> Self
Construct from parsed components.
Sourcepub fn from_manifest(
binary_version: &str,
build_number: u64,
) -> Result<Self, Error>
pub fn from_manifest( binary_version: &str, build_number: u64, ) -> Result<Self, Error>
Parse a release manifest’s version fields.
Manifest builds are never development builds.
§Errors
Returns an error if binary_version is not valid semver.
Sourcepub fn build_number(&self) -> u64
pub fn build_number(&self) -> u64
The build number.
Sourcepub fn is_dev_build(&self) -> bool
pub fn is_dev_build(&self) -> bool
Whether this is a local development build.
Sourcepub fn compare_for_upgrade(
&self,
available: &Self,
allow_override: bool,
) -> UpgradeDecision
pub fn compare_for_upgrade( &self, available: &Self, allow_override: bool, ) -> UpgradeDecision
Compare this version against an available release to determine whether an upgrade should proceed.
When allow_override is true, downgrades and development-build
overrides are allowed.
Trait Implementations§
Source§impl Clone for BuildVersion
impl Clone for BuildVersion
Source§fn clone(&self) -> BuildVersion
fn clone(&self) -> BuildVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more