introduce backend modules

This commit is contained in:
Dr. Matthias Ratajczak committed 2023-01-05 16:30:13 +01:00
1 parent 6e21a562bf
commit b009b236c3
2 files changed
+15 -7

No files matched your search

+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 {