introduce backend modules

This commit is contained in:
steven-omaha
2023-01-05 16:30:13 +01:00
parent 53ffda70ce
commit ddcb5dec3d
2 changed files with 15 additions and 7 deletions
+14
View File
@@ -0,0 +1,14 @@
mod pacman;
use std::collections::HashSet;
use crate::Package;
pub use pacman::Pacman;
pub trait Backend {
/// 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>;
}
+1 -7
View File
@@ -3,15 +3,9 @@ use std::collections::HashSet;
use alpm::Alpm;
use alpm::PackageReason::Explicit;
use super::Backend;
use crate::Package;
pub trait Backend {
/// 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>;
}
pub struct Pacman;
impl Backend for Pacman {