pub struct BuildVersion { /* private fields */ }Expand description
A parsed release version combining semantic version, build number, and development-build provenance.
Equal semantic versions compare build numbers only when both values
are releases. If either is a development build, an explicit override
is required and UpgradeDecision::DevBuild is returned otherwise.
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§impl Debug for BuildVersion
impl Debug for BuildVersion
Source§impl Default for BuildVersion
impl Default for BuildVersion
Auto Trait Implementations§
impl Forget for BuildVersion
impl Freeze for BuildVersion
impl Move for BuildVersion
impl RefUnwindSafe for BuildVersion
impl Send for BuildVersion
impl Sync for BuildVersion
impl Unpin for BuildVersion
impl UnsafeUnpin for BuildVersion
impl UnwindSafe for BuildVersion
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