#[repr(C)]pub struct Semver {
pub major: u16,
pub minor: u16,
pub patch: u32,
}Expand description
Semantic version. The ‘patch’ is u32 only because we want this structure to fit into 64 bits.
Fields§
§major: u16Major version.
minor: u16Minor version.
patch: u32Patch version.
Implementations§
source§impl Semver
impl Semver
sourcepub const fn new(major: u16, minor: u16, patch: u32) -> Self
pub const fn new(major: u16, minor: u16, patch: u32) -> Self
Create a semantic versioning instance.
sourcepub const fn swap_bytes(&self) -> Self
pub const fn swap_bytes(&self) -> Self
Return the semver in the opposite endian.
Trait Implementations§
source§impl Ord for Semver
impl Ord for Semver
source§impl PartialEq for Semver
impl PartialEq for Semver
source§impl PartialOrd for Semver
impl PartialOrd for Semver
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Copy for Semver
impl Eq for Semver
impl StructuralEq for Semver
impl StructuralPartialEq for Semver
Auto Trait Implementations§
impl RefUnwindSafe for Semver
impl Send for Semver
impl Sync for Semver
impl Unpin 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