Expand description
§release-version
Typed release-version comparison for applications that publish semantic versions alongside monotonically increasing build numbers.
§What it models
release-version keeps three pieces of release identity together:
- a parsed
semver::Version; - a monotonically increasing build number;
- whether the value came from a development build or a release build.
BuildVersion::compare_for_upgrade applies a small, explicit policy:
- newer semantic versions are upgrades;
- older semantic versions are downgrades unless an explicit override was requested;
- equal semantic versions compare release build numbers;
- development builds do not compare their build number with a release build unless explicitly overridden.
The crate does not read the environment, contact a registry, parse a manifest
format, or perform an upgrade. Callers supply typed values and decide what to
do with the returned UpgradeDecision.
§Example
use release_version::{BuildVersion, UpgradeDecision};
use semver::Version;
let current = BuildVersion::new(Version::new(1, 4, 0), 12, false);
let available = BuildVersion::from_manifest("1.5.0", 3).expect("valid version");
assert_eq!(
current.compare_for_upgrade(&available, false),
UpgradeDecision::Upgrade,
);§License
Licensed under either of:
- Apache License, Version 2.0
- MIT License
at your option.
§Maintenance
CI uses the shared tested-revision publisher with three-platform
extracted-package tests, scoped App updates and daily dependency checks.
Build scripts pass their checkout directory explicitly to Rhusky;
repository environment settings are not publishing or hook authority.
See .github/PUBLISH.md for the single release path.
Pure release-version comparison types with no build-script coupling.
Structs§
- Build
Version - A parsed release version combining semantic version, build number, and development-build provenance.
Enums§
- Upgrade
Decision - The outcome of comparing the current build version against a release manifest.