pub struct Version {
pub major: u8,
pub minor: u8,
pub patch: u8,
}
Expand description
The version of an Ubuntu release, which is based on the date of release.
Fields§
§major: u8
§minor: u8
§patch: u8
Implementations§
Source§impl Version
impl Version
Sourcepub fn detect() -> Result<Self, VersionError>
pub fn detect() -> Result<Self, VersionError>
Reads the /etc/os-release
file and determines which version of Ubuntu is in use.
Sourcepub fn months_since(self) -> i32
pub fn months_since(self) -> i32
The number of months that have passed since this version was released.
Sourcepub fn next_release(self) -> Self
pub fn next_release(self) -> Self
Increments the major / minor version to the next expected release version.
Trait Implementations§
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