pub(crate) struct Version(Version);Expand description
A validated semantic version used throughout release policy.
Tuple Fields§
§0: VersionImplementations§
Source§impl Version
impl Version
Sourcepub(crate) fn parse(value: &str) -> Result<Self, Error>
pub(crate) fn parse(value: &str) -> Result<Self, Error>
Parse strict semver, which rejects partial versions such as 1.2 and
leading zeros.
§Errors
Returns an error when value is not a strict semantic version.
Sourcepub(crate) fn next_patch(&self) -> Option<Self>
pub(crate) fn next_patch(&self) -> Option<Self>
Return the next patch release, clearing prerelease and build metadata. A prerelease advances the patch component before becoming stable.
Sourcepub(crate) fn next_minor(&self) -> Option<Self>
pub(crate) fn next_minor(&self) -> Option<Self>
Return the next minor release, clearing prerelease and build metadata.
Sourcepub(crate) fn next_major(&self) -> Option<Self>
pub(crate) fn next_major(&self) -> Option<Self>
Return the next major release, clearing prerelease and build metadata.
Sourcepub(crate) fn is_unversioned(&self) -> bool
pub(crate) fn is_unversioned(&self) -> bool
Whether this is 0.0.0, the version of a unit with no release yet.
Sourcepub(crate) const fn is_initial_development(&self) -> bool
pub(crate) const fn is_initial_development(&self) -> bool
Whether this version is below 1.0.0, ignoring prerelease.
Sourcepub(crate) fn precedence_cmp(&self, other: &Self) -> Ordering
pub(crate) fn precedence_cmp(&self, other: &Self) -> Ordering
Compare semantic precedence, ignoring build metadata.
Trait Implementations§
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze 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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.