pub enum SystemPackageManager {
Pkg,
Pkgin,
Apk,
Apt,
Dnf,
Pacman,
Yum,
Brew,
Choco,
Scoop,
All,
}Expand description
Package manager of the system environment.
Variants§
Implementations§
Source§impl SystemPackageManager
impl SystemPackageManager
Sourcepub fn detect() -> Result<Self, Error>
pub fn detect() -> Result<Self, Error>
Detect the package manager from the current system environment using the following rules:
- On Linux, parses
/etc/os-release. - On MacOS and BSD, checks for commands on
PATH. - On Windows, checks for programs on
PATH, usingPATHEXT.
Sourcepub fn get_config(&self) -> PackageManagerConfig
pub fn get_config(&self) -> PackageManagerConfig
Return vendor configuration for the current package manager.
Sourcepub fn get_elevated_command(&self) -> Option<&str>
pub fn get_elevated_command(&self) -> Option<&str>
Return the command to use for elevated access. On Unix, this will use “doas” or “sudo”, and on Windows or WASM this does nothing.
Trait Implementations§
Source§impl Clone for SystemPackageManager
impl Clone for SystemPackageManager
Source§fn clone(&self) -> SystemPackageManager
fn clone(&self) -> SystemPackageManager
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 SystemPackageManager
impl Debug for SystemPackageManager
Source§impl<'de> Deserialize<'de> for SystemPackageManager
impl<'de> Deserialize<'de> for SystemPackageManager
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 Display for SystemPackageManager
impl Display for SystemPackageManager
Source§impl Hash for SystemPackageManager
impl Hash for SystemPackageManager
Source§impl PartialEq for SystemPackageManager
impl PartialEq for SystemPackageManager
Source§impl Serialize for SystemPackageManager
impl Serialize for SystemPackageManager
impl Copy for SystemPackageManager
impl Eq for SystemPackageManager
impl StructuralPartialEq for SystemPackageManager
Auto Trait Implementations§
impl Freeze for SystemPackageManager
impl RefUnwindSafe for SystemPackageManager
impl Send for SystemPackageManager
impl Sync for SystemPackageManager
impl Unpin for SystemPackageManager
impl UnwindSafe for SystemPackageManager
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