pub struct Version {
pub major: u64,
pub minor: u64,
pub patch: u64,
pub pre: Prerelease,
pub build: BuildMetadata,
}Expand description
A semantic version number (MAJOR.MINOR.PATCH[-prerelease][+build])
Fields§
§major: u64Major version (breaking changes)
minor: u64Minor version (new features, backwards compatible)
patch: u64Patch version (bug fixes, backwards compatible)
pre: PrereleasePre-release identifier (e.g., alpha, beta, rc.1)
build: BuildMetadataBuild metadata (ignored in version precedence)
Implementations§
Source§impl Version
impl Version
Sourcepub fn is_prerelease(&self) -> bool
pub fn is_prerelease(&self) -> bool
Check if this is a prerelease version
Sourcepub fn bump_major(&self) -> Self
pub fn bump_major(&self) -> Self
Bump the major version (resets minor, patch, prerelease)
Sourcepub fn bump_minor(&self) -> Self
pub fn bump_minor(&self) -> Self
Bump the minor version (resets patch, prerelease)
Sourcepub fn bump_patch(&self) -> Self
pub fn bump_patch(&self) -> Self
Bump the patch version (resets prerelease)
Sourcepub fn with_prerelease(self, pre: Prerelease) -> Self
pub fn with_prerelease(self, pre: Prerelease) -> Self
Set prerelease identifier
Sourcepub fn with_build(self, build: BuildMetadata) -> Self
pub fn with_build(self, build: BuildMetadata) -> Self
Set build metadata
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
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 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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.