pub struct Release { /* private fields */ }Expand description
One published release of this project, in the form both spellings decode to.
Field order is the comparison order, and the comparison order is semver’s: version first, then the date inside the pre-release field.
Implementations§
Source§impl Release
impl Release
Sourcepub fn from_tag(tag: &str, expected_version: &str) -> Result<Release, AxError>
pub fn from_tag(tag: &str, expected_version: &str) -> Result<Release, AxError>
The release a git tag names.
expected_version is the version the caller was built from -
workspace.package.version for xtask, CARGO_PKG_VERSION for
the binary. Both callers hold the same number, and a tag that
disagrees with it is refused here rather than producing a release
whose name and whose contents state different versions.
§Errors
When the tag is not shaped like a release of this project, when
its version disagrees with expected_version, or when its date
is not a real day.
Sourcepub fn from_published_tag(tag: &str) -> Result<Release, AxError>
pub fn from_published_tag(tag: &str) -> Result<Release, AxError>
A published tag, including releases cut before the current maturity.
§Errors
When neither supported maturity decodes the tag’s version and date.
Sourcepub fn version(&self) -> String
pub fn version(&self) -> String
0.0.5, the number alone, which is also the version crates.io
carries.
Sourcepub fn npm_version(&self) -> String
pub fn npm_version(&self) -> String
0.0.5-pre.260912, the version npm carries.