pub struct SemanticVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
Semantic version following SemVer 2.0.0.
Fields§
§major: u32Major version (breaking changes).
minor: u32Minor version (feature additions).
patch: u32Patch version (bug fixes).
Implementations§
Source§impl SemanticVersion
impl SemanticVersion
Sourcepub fn parse(s: &str) -> Result<Self, String>
pub fn parse(s: &str) -> Result<Self, String>
Parse semantic version from string (e.g., “0.1.0”).
Sourcepub fn is_compatible_with(&self, minimum: SemanticVersion) -> bool
pub fn is_compatible_with(&self, minimum: SemanticVersion) -> bool
Check if this version is compatible with a minimum required version.
Sourcepub fn bump_major(&mut self)
pub fn bump_major(&mut self)
Increment major version (reset minor and patch).
Sourcepub fn bump_minor(&mut self)
pub fn bump_minor(&mut self)
Increment minor version (reset patch).
Sourcepub fn bump_patch(&mut self)
pub fn bump_patch(&mut self)
Increment patch version.
Trait Implementations§
Source§impl Clone for SemanticVersion
impl Clone for SemanticVersion
Source§fn clone(&self) -> SemanticVersion
fn clone(&self) -> SemanticVersion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticVersion
impl Debug for SemanticVersion
Source§impl Display for SemanticVersion
impl Display for SemanticVersion
Source§impl Ord for SemanticVersion
impl Ord for SemanticVersion
Source§fn cmp(&self, other: &SemanticVersion) -> Ordering
fn cmp(&self, other: &SemanticVersion) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SemanticVersion
impl PartialEq for SemanticVersion
Source§impl PartialOrd for SemanticVersion
impl PartialOrd for SemanticVersion
impl Copy for SemanticVersion
impl Eq for SemanticVersion
impl StructuralPartialEq for SemanticVersion
Auto Trait Implementations§
impl Freeze for SemanticVersion
impl RefUnwindSafe for SemanticVersion
impl Send for SemanticVersion
impl Sync for SemanticVersion
impl Unpin for SemanticVersion
impl UnsafeUnpin for SemanticVersion
impl UnwindSafe for SemanticVersion
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