add install and remove packages to Backend trait

This commit is contained in:
Dr. Matthias Ratajczak
2023-01-05 16:44:41 +01:00
parent b009b236c3
commit c77819acf5
4 changed files with 31 additions and 24 deletions
+6
View File
@@ -7,8 +7,14 @@ use crate::Package;
pub use pacman::Pacman;
pub trait Backend {
/// The binary that should be called to run the associated package manager.
const BINARY: &'static str;
/// Get all packages that are installed in the system.
fn get_all_installed_packages() -> HashSet<Package>;
/// Get all packages that were installed in the system explicitly.
fn get_explicitly_installed_packages() -> HashSet<Package>;
/// Install the specified packages.
fn install_packages(packages: Vec<Package>);
/// Remove the specified packages.
fn remove_packages(packages: Vec<Package>);
}