pub struct FixedVersion {
pub major: u64,
pub minor: u64,
pub patch: u64,
}Expand description
A semver for a type, but without pre release, build meta etc.
Fields§
§major: u64The major version number.
minor: u64The minor version number.
patch: u64The patch version number.
Implementations§
Source§impl FixedVersion
impl FixedVersion
Sourcepub const fn const_to_bytes(&self) -> [u8; 24]
pub const fn const_to_bytes(&self) -> [u8; 24]
Get the bytes of the version, can be used in const context.
It’s slower than [as_bytes], but can be used in const context.
Sourcepub fn is_compatible(&self, expected_version: &FixedVersion) -> bool
pub fn is_compatible(&self, expected_version: &FixedVersion) -> bool
If a FixedVersion compatible with another FixedVersion
Sourcepub fn matches(&self, comparator: &Comparator) -> bool
pub fn matches(&self, comparator: &Comparator) -> bool
If a FixedVersion matches a semver::Comparator?
Trait Implementations§
Source§impl Clone for FixedVersion
impl Clone for FixedVersion
Source§fn clone(&self) -> FixedVersion
fn clone(&self) -> FixedVersion
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 FixedVersion
impl Debug for FixedVersion
Source§impl From<FixedVersion> for (u64, u64, u64)
impl From<FixedVersion> for (u64, u64, u64)
Source§fn from(value: FixedVersion) -> Self
fn from(value: FixedVersion) -> Self
Converts to this type from the input type.
Source§impl From<FixedVersion> for Version
impl From<FixedVersion> for Version
Source§fn from(value: FixedVersion) -> Self
fn from(value: FixedVersion) -> Self
Converts to this type from the input type.
Source§impl From<Version> for FixedVersion
impl From<Version> for FixedVersion
Source§impl Hash for FixedVersion
impl Hash for FixedVersion
Source§impl Ord for FixedVersion
impl Ord for FixedVersion
Source§fn cmp(&self, other: &FixedVersion) -> Ordering
fn cmp(&self, other: &FixedVersion) -> 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 FixedVersion
impl PartialEq for FixedVersion
Source§impl PartialOrd for FixedVersion
impl PartialOrd for FixedVersion
impl Copy for FixedVersion
impl Eq for FixedVersion
impl StructuralPartialEq for FixedVersion
Auto Trait Implementations§
impl Freeze for FixedVersion
impl RefUnwindSafe for FixedVersion
impl Send for FixedVersion
impl Sync for FixedVersion
impl Unpin for FixedVersion
impl UnwindSafe for FixedVersion
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