pub enum HostPackageManager {
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<SystemPackageManager, Error>
pub fn detect() -> Result<SystemPackageManager, 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§const fn clone_from(&mut self, source: &Self)
const 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<SystemPackageManager, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SystemPackageManager, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string()
Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more