pub struct Version {
pub major: u64,
pub minor: u64,
pub patch: u64,
pub rc: Option<u64>,
}Expand description
A release version: <major>.<minor>.<patch>, and the candidate number
when it is a release candidate. Any other prerelease or build segment
is not a version release-kit writes or reads.
Fields§
§major: u64The major position.
minor: u64The minor position.
patch: u64The patch position.
rc: Option<u64>The candidate number, for a release candidate.
Implementations§
Source§impl Version
impl Version
Sourcepub fn parse(text: &str) -> Option<Self>
pub fn parse(text: &str) -> Option<Self>
Parse the semver spelling 1.4.3 or 1.4.3-rc.2, or the PEP 440
spelling 1.4.3rc2.
Sourcepub fn from_tag(tag: &str) -> Option<Self>
pub fn from_tag(tag: &str) -> Option<Self>
The version a release tag names: v1.4.3 or v1.4.3-rc.2.
Sourcepub fn spelled(self, driver: &str) -> String
pub fn spelled(self, driver: &str) -> String
The version as the driver’s manifest spells it: PEP 440 for python, semver for every other driver.
SATISFIES release-engine:the-python-version-maps-to-the-tag
Sourcepub fn tag(self) -> String
pub fn tag(self) -> String
The tag the release creates for this version, the same on every
driver: the semver spelling behind a v.
Sourcepub const fn is_candidate(self) -> bool
pub const fn is_candidate(self) -> bool
Whether the version is a release candidate.
Trait Implementations§
impl Copy for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Forget for Version
impl Freeze for Version
impl Move for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnsafeUnpin for Version
impl UnwindSafe for Version
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.