Struct upm_lib::PackageManager
[−]
[src]
pub struct PackageManager { pub name: String, pub version: String, pub config_dir: PathBuf, pub install: Option<String>, pub install_local: Option<String>, pub remove: Option<String>, pub remove_local: Option<String>, pub search: Option<String>, }
The representation of a package manager. Includes the name of the package manager, a path to reference scripts from, and commands in string form (or scripts to call package manager commands and properly format the output).
Fields
name: String
version: String
config_dir: PathBuf
install: Option<String>
install_local: Option<String>
remove: Option<String>
remove_local: Option<String>
search: Option<String>
Methods
impl PackageManager
[src]
fn exists(&self) -> bool
[src]
Check if the PackageManager is installed by seeing if the version command exits with a status code of 0.
fn has_command(&self, name: &str) -> bool
[src]
Check if the specified command field of the struct is some
fn run_command(&self, name: &str, args: &str) -> Result<Child, Error>
[src]
Attempt to run the PackageManager command specified by name. Arguments can be supplied with the args parameter.
fn install(&self, args: &str) -> Result<Child, Error>
[src]
Run the install command with the provided arguments
fn uninstall(&self, args: &str) -> Result<Child, Error>
[src]
Run the uninstall command with the provided arguments
fn search(&self, args: &str) -> Result<Child, Error>
[src]
Run the search command with the provided arguments
fn get_name(&self) -> String
[src]
Get the name of the package manager
fn get_config_dir(self) -> PathBuf
[src]
Get the directory of the configuration file that describes the PackageManager
fn version(self) -> Result<Child, Error>
[src]
Run the version command
fn get_version(self) -> Result<Version, Error>
[src]
Get the Version of the package manager
fn from_file<P: AsRef<Path>>(path: P) -> Result<PackageManager, Error>
[src]
Read a toml configuration file with a PackageManager description and create a PackageManager from this info.
Trait Implementations
impl Eq for PackageManager
[src]
impl Clone for PackageManager
[src]
fn clone(&self) -> PackageManager
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for PackageManager
[src]
fn default() -> PackageManager
[src]
Returns the "default value" for a type. Read more
impl PartialEq for PackageManager
[src]
fn eq(&self, other: &PackageManager) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Ord for PackageManager
[src]
fn cmp(&self, other: &PackageManager) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for PackageManager
[src]
fn partial_cmp(&self, other: &PackageManager) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more