pub struct Version {
pub major: u32,
pub minor: u32,
pub patch: u32,
}
Expand description
Represents a semantic version number
Fields§
§major: u32
Major version (breaking changes)
minor: u32
Minor version (new features, backward compatible)
patch: u32
Patch version (bug fixes)
Implementations§
Source§impl Version
impl Version
Sourcepub const CURRENT_BETA: &'static str = "0.1.0-beta.4"
pub const CURRENT_BETA: &'static str = "0.1.0-beta.4"
Current beta release identifier
Sourcepub fn parse(versionstr: &str) -> Result<Self, String>
pub fn parse(versionstr: &str) -> Result<Self, String>
Parse a version string like “1.2.3” or “1.2.3-beta.1”
Sourcepub fn is_compatible_with(&self, other: &Version) -> bool
pub fn is_compatible_with(&self, other: &Version) -> bool
Check if this version is compatible with another
Trait Implementations§
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Copy 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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more