pub struct SemVer { /* private fields */ }Expand description
Semantic version in the form MAJOR.MINOR.PATCH with optional pre-release
and build metadata identifiers.
Parses 1.2.3, 1.2.3-beta.1, 1.2.3+build.456, and
1.2.3-alpha.1+build.456.
Implementations§
Source§impl SemVer
impl SemVer
Sourcepub fn new(major: u64, minor: u64, patch: u64) -> Self
pub fn new(major: u64, minor: u64, patch: u64) -> Self
Creates a SemVer with no pre-release or build metadata.
Sourcepub fn parse(s: &str) -> PrimitiveResult<Self>
pub fn parse(s: &str) -> PrimitiveResult<Self>
Parses a semver string.
pub fn major(&self) -> u64
pub fn minor(&self) -> u64
pub fn patch(&self) -> u64
Sourcepub fn is_pre_release(&self) -> bool
pub fn is_pre_release(&self) -> bool
Returns true if this is a pre-release version.
Trait Implementations§
Source§impl Ord for SemVer
impl Ord for SemVer
1.21.0 (const: unstable) · 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 PartialOrd for SemVer
impl PartialOrd for SemVer
impl Eq for SemVer
impl StructuralPartialEq for SemVer
Auto Trait Implementations§
impl Freeze for SemVer
impl RefUnwindSafe for SemVer
impl Send for SemVer
impl Sync for SemVer
impl Unpin for SemVer
impl UnsafeUnpin for SemVer
impl UnwindSafe for SemVer
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