pub struct DatabaseConfig {
database_dir: PathBuf,
lock_file: PathBuf,
transaction_data_dir: PathBuf,
}Expand description
A configuration for transactions and the various locations that they rely on.
Fields§
§database_dir: PathBufThe path to the alpm-db root directory.
lock_file: PathBufThe path of the lock file for the transaction/database.
transaction_data_dir: PathBufThe data directory for current and past transactions.
Below this directory the following data is kept:
- current transaction plan
- past transaction plans
- temporary data for current transaction plan
Implementations§
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub const PACMAN_DATABASE_DIR: &str = "/var/lib/pacman/local"
pub const PACMAN_DATABASE_DIR: &str = "/var/lib/pacman/local"
The default pacman database location.
Sourcepub const PACMAN_DATABASE_LOCK_FILE: &str = "/var/lib/pacman/db.lck"
pub const PACMAN_DATABASE_LOCK_FILE: &str = "/var/lib/pacman/db.lck"
The default pacman database lock file location.
Sourcepub const TRANSACTION_DATA_DIR: &str = "/var/lib/alpm/alpm-db"
pub const TRANSACTION_DATA_DIR: &str = "/var/lib/alpm/alpm-db"
The default location for transaction plans and temporary data for transactions.
Sourcepub fn new(
database_dir: PathBuf,
lock_file: PathBuf,
transaction_data_dir: PathBuf,
) -> Result<Self, Error>
pub fn new( database_dir: PathBuf, lock_file: PathBuf, transaction_data_dir: PathBuf, ) -> Result<Self, Error>
Creates a new DatabaseConfig.
Sourcepub fn database_dir(&self) -> &Path
pub fn database_dir(&self) -> &Path
Returns the path of the database directory.
Sourcepub fn transaction_data_dir(&self) -> &Path
pub fn transaction_data_dir(&self) -> &Path
Returns the path of the transaction data directory.
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Source§impl Default for DatabaseConfig
impl Default for DatabaseConfig
Source§fn default() -> Self
fn default() -> Self
Returns a default DatabaseConfig.
Uses Self::PACMAN_DATABASE_DIR database directory, Self::PACMAN_DATABASE_LOCK_FILE
as lock file location and Self::TRANSACTION_DATA_DIR as transaction data directory.