pub struct SemVer {
pub major: u8,
pub minor: u8,
pub patch: u8,
}Expand description
A semantic library version, ordered by major, then minor, then patch.
The field declaration order matters: the derived Ord/PartialOrd compare fields
lexicographically in declaration order, which is exactly semantic-version precedence.
A semantic version can often also take a suffix, e.g. “alpha”, “beta”, “rc1”, etc.
We’re not going to model that here because it’s not useful for versioning serialized states.
Fields§
§major: u8§minor: u8§patch: u8Trait 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 Copy 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