pub struct SemanticVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
pub prerelease: Option<String>,
}Expand description
Semantic version for comparison
Fields§
§major: u32§minor: u32§patch: u32§prerelease: Option<String>Implementations§
Source§impl SemanticVersion
impl SemanticVersion
Sourcepub fn parse(version_str: &str) -> Result<Self>
pub fn parse(version_str: &str) -> Result<Self>
Parse version from string (e.g., “1.2.3” or “1.2.3-beta”)
Sourcepub fn is_newer_than(&self, other: &SemanticVersion) -> bool
pub fn is_newer_than(&self, other: &SemanticVersion) -> bool
Check if this version is newer than another
Sourcepub fn is_breaking_change(&self, previous: &SemanticVersion) -> bool
pub fn is_breaking_change(&self, previous: &SemanticVersion) -> bool
Check if this is a breaking change (major version bump)
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 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 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
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.