pub enum PackageManager {
Apt,
Yum,
Dnf,
Pacman,
Homebrew,
Chocolatey,
Snap,
Flatpak,
}Expand description
Supported package managers
Variants§
Apt
Debian/Ubuntu package manager
Yum
RHEL/CentOS legacy package manager
Dnf
Fedora/RHEL 8+ package manager
Pacman
Arch Linux package manager
Homebrew
macOS package manager
Chocolatey
Windows package manager
Snap
Universal Linux package manager
Flatpak
Universal Linux package manager
Implementations§
Source§impl PackageManager
impl PackageManager
Sourcepub fn detect() -> Result<PackageManager, PackageManagerError>
pub fn detect() -> Result<PackageManager, PackageManagerError>
Detect the primary package manager on the current system
Sourcepub fn detect_all() -> Vec<PackageManager>
pub fn detect_all() -> Vec<PackageManager>
Get all available package managers on the system
Trait Implementations§
Source§impl Clone for PackageManager
impl Clone for PackageManager
Source§impl Debug for PackageManager
impl Debug for PackageManager
Source§impl<'de> Deserialize<'de> for PackageManager
impl<'de> Deserialize<'de> for PackageManager
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PackageManagerOps for PackageManager
impl PackageManagerOps for PackageManager
Source§fn update_packages(&self) -> Result<String, PackageManagerError>
fn update_packages(&self) -> Result<String, PackageManagerError>
Update package database
Source§fn upgrade_packages(&self) -> Result<String, PackageManagerError>
fn upgrade_packages(&self) -> Result<String, PackageManagerError>
Upgrade all packages
Source§fn install_packages(
&self,
packages: &[&str],
) -> Result<String, PackageManagerError>
fn install_packages( &self, packages: &[&str], ) -> Result<String, PackageManagerError>
Install specific packages
Source§fn is_package_installed(
&self,
package: &str,
) -> Result<bool, PackageManagerError>
fn is_package_installed( &self, package: &str, ) -> Result<bool, PackageManagerError>
Check if package is installed
Source§fn list_updates(&self) -> Result<Vec<String>, PackageManagerError>
fn list_updates(&self) -> Result<Vec<String>, PackageManagerError>
List available updates
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Check if this package manager is available on the system
Source§impl PartialEq for PackageManager
impl PartialEq for PackageManager
Source§impl Serialize for PackageManager
impl Serialize 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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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