pub struct Version { /* private fields */ }
Expand description
A two component Version which can be encoded according to LCS4
Implementations§
Source§impl Version
impl Version
Sourcepub const fn from_pair_nonzero(
major: NonZeroU16,
minor: u8,
) -> Result<Self, OutOfRange<NonZeroU16>>
pub const fn from_pair_nonzero( major: NonZeroU16, minor: u8, ) -> Result<Self, OutOfRange<NonZeroU16>>
Obtains the version from the given pair
Sourcepub const fn from_pair(maj: u16, minor: u8) -> Result<Self, OutOfRange<u16>>
pub const fn from_pair(maj: u16, minor: u8) -> Result<Self, OutOfRange<u16>>
Obtains the version from the given pair
Sourcepub const fn from_encoded(v: u16) -> Self
pub const fn from_encoded(v: u16) -> Self
Decodes the given version into the fields of the verison, according to LCS 4
Sourcepub const fn into_encoded(self) -> u16
pub const fn into_encoded(self) -> u16
Encodes the version into a u16, according to LCS 4.
Sourcepub const fn origin(self) -> Version
pub const fn origin(self) -> Version
Obtains the version with the same major component but a 0 minor component
Sourcepub fn same_origin(self) -> impl RangeBounds<Version>
pub fn same_origin(self) -> impl RangeBounds<Version>
Returns a Range of versions that include all version from the origin to the current (inclusive)
Sourcepub const fn major(self) -> NonZeroU16
pub const fn major(self) -> NonZeroU16
Obtains the major field, between 1 and 256 inclusive
Sourcepub const fn major_encoded(self) -> u8
pub const fn major_encoded(self) -> u8
Obtains the encoded major field, which is self.major()-1
Trait Implementations§
Source§impl DeserializeCopy for Version
impl DeserializeCopy for Version
Source§impl Deserializeable for Version
impl Deserializeable for Version
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
Source§impl Serializeable for Version
impl Serializeable 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