diff --git a/src/backend/mod.rs b/src/backend/mod.rs new file mode 100644 index 0000000..9b884b0 --- /dev/null +++ b/src/backend/mod.rs @@ -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; + /// Get all packages that were installed in the system explicitly. + fn get_explicitly_installed_packages() -> HashSet; +} diff --git a/src/backend.rs b/src/backend/pacman.rs similarity index 79% rename from src/backend.rs rename to src/backend/pacman.rs index 57314e3..756e6ff 100644 --- a/src/backend.rs +++ b/src/backend/pacman.rs @@ -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; - /// Get all packages that were installed in the system explicitly. - fn get_explicitly_installed_packages() -> HashSet; -} - pub struct Pacman; impl Backend for Pacman {