introduce backend modules
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
@@ -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 {
|
||||
Reference in New Issue
Block a user