Struct ubuntu_version::Version
source · [−]Expand description
The version of an Ubuntu release, which is based on the date of release.
Fields
major: u8
minor: u8
patch: u8
Implementations
sourceimpl 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 StructuralEq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more