pub enum Distribution {
Ubuntu,
Debian,
Other(String),
}Expand description
Represents a Linux distribution
Variants§
Implementations§
Source§impl Distribution
impl Distribution
Sourcepub fn current() -> Option<Distribution>
pub fn current() -> Option<Distribution>
Get the current system’s distribution information
Returns None if /etc/os-release is not present or cannot be parsed.
Sourcepub fn default_components(&self) -> Vec<&'static str>
pub fn default_components(&self) -> Vec<&'static str>
Get default components for this distribution
Sourcepub fn sources_basename(&self) -> Option<&'static str>
pub fn sources_basename(&self) -> Option<&'static str>
Get the base name for the main sources file for this distribution
For example, returns “ubuntu” for Ubuntu, “debian” for Debian. This can be used to construct filenames like “ubuntu.sources”.
Sourcepub fn is_main_repository(&self, repo: &Repository) -> bool
pub fn is_main_repository(&self, repo: &Repository) -> bool
Check if a repository is a main distribution repository
Trait Implementations§
Source§impl Clone for Distribution
impl Clone for Distribution
Source§fn clone(&self) -> Distribution
fn clone(&self) -> Distribution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Distribution
impl Debug for Distribution
Source§impl Display for Distribution
impl Display for Distribution
Source§impl PartialEq for Distribution
impl PartialEq for Distribution
Source§fn eq(&self, other: &Distribution) -> bool
fn eq(&self, other: &Distribution) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Distribution
Auto Trait Implementations§
impl Freeze for Distribution
impl RefUnwindSafe for Distribution
impl Send for Distribution
impl Sync for Distribution
impl Unpin for Distribution
impl UnsafeUnpin for Distribution
impl UnwindSafe for Distribution
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more