pub enum PackageManager {
Apk,
Apt,
Dnf,
Pacman,
Portage,
Zypper,
}Expand description
Supported Linux package managers.
Variants§
Apk
Alpine apk.
Apt
Debian/Ubuntu apt.
Dnf
Fedora/RHEL dnf.
Pacman
Arch pacman.
Portage
Gentoo portage.
Zypper
openSUSE zypper.
Implementations§
Source§impl PackageManager
impl PackageManager
Sourcepub fn detect() -> Result<Self>
pub fn detect() -> Result<Self>
Detects the package manager by reading /etc/os-release.
§Errors
InvalidDataif the/etc/os-releasedoes not contain anID=andID_LIKEentry.InvalidInputif the discovered ID is not in the supported list.- Other
io::Errorvariants propagated fromfs::read_to_string.
Sourcepub fn package_count(&self) -> Result<u64>
pub fn package_count(&self) -> Result<u64>
Returns the installed package count for the manager.
§Errors
Returns an error if the command fails, output is invalid UTF-8, output is empty, or the count cannot be parsed as an integer.
Trait Implementations§
Source§impl Clone for PackageManager
impl Clone for PackageManager
Source§fn clone(&self) -> PackageManager
fn clone(&self) -> PackageManager
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 PackageManager
impl Debug for PackageManager
Source§impl PartialEq for PackageManager
impl PartialEq for PackageManager
impl Copy for PackageManager
impl Eq for PackageManager
impl StructuralPartialEq for PackageManager
Auto Trait Implementations§
impl Freeze for PackageManager
impl RefUnwindSafe for PackageManager
impl Send for PackageManager
impl Sync for PackageManager
impl Unpin for PackageManager
impl UnsafeUnpin for PackageManager
impl UnwindSafe for PackageManager
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