Struct pacmanconf::Config
source · [−]pub struct Config {Show 27 fields
pub root_dir: String,
pub db_path: String,
pub cache_dir: Vec<String>,
pub hook_dir: Vec<String>,
pub gpg_dir: String,
pub log_file: String,
pub hold_pkg: Vec<String>,
pub ignore_pkg: Vec<String>,
pub ignore_group: Vec<String>,
pub architecture: Vec<String>,
pub xfer_command: String,
pub no_upgrade: Vec<String>,
pub no_extract: Vec<String>,
pub clean_method: Vec<String>,
pub sig_level: Vec<String>,
pub local_file_sig_level: Vec<String>,
pub remote_file_sig_level: Vec<String>,
pub use_syslog: bool,
pub color: bool,
pub use_delta: f64,
pub total_download: bool,
pub check_space: bool,
pub verbose_pkg_lists: bool,
pub disable_download_timeout: bool,
pub parallel_downloads: u64,
pub chomp: bool,
pub repos: Vec<Repository>,
}
Expand description
A pacman config.
See pacman.conf (5) for information on each field.
Fields
root_dir: String
RootDir
db_path: String
DBPath
cache_dir: Vec<String>
CacheDir
hook_dir: Vec<String>
HookDir
gpg_dir: String
GPGDir
log_file: String
LogFile
hold_pkg: Vec<String>
HoldPkg
ignore_pkg: Vec<String>
IgnorePkg
ignore_group: Vec<String>
IgnoreGroup
architecture: Vec<String>
Architecture
xfer_command: String
XferCommand
no_upgrade: Vec<String>
NoUpgrade
no_extract: Vec<String>
NoExtract
clean_method: Vec<String>
CleanMethod
sig_level: Vec<String>
SigLevel
local_file_sig_level: Vec<String>
LocalFileSigLevel
remote_file_sig_level: Vec<String>
RemoteFileSigLevel
use_syslog: bool
UseSyslog
color: bool
Color
use_delta: f64
UseDelta
total_download: bool
TotalDownload
check_space: bool
CheckSpace
verbose_pkg_lists: bool
VerpsePkgLists
disable_download_timeout: bool
DisableDownloadTimeout
parallel_downloads: u64
ParallelDownloads
chomp: bool
ILoveCandy
repos: Vec<Repository>
[repo_name]
Implementations
sourceimpl Config
impl Config
sourcepub fn new() -> Result<Config, Error>
pub fn new() -> Result<Config, Error>
Creates a new Config from the default pacman.conf.
The default pacman.conf location is a compile time option of pacman but is usually located at /etc/pacman.conf.
sourcepub fn empty() -> Result<Config, Error>
pub fn empty() -> Result<Config, Error>
Creates a new Config using pacman’s compiled in defaults.
Parsing an empty file causes pacman-conf to fill in each
field with pacman’s compiled in default values. This should
not be confused with the Default::default()
function which
is derived and will give rust’s default values eg:
empty string, 0, etc.
sourcepub fn from_file<T: AsRef<OsStr>>(config: T) -> Result<Config, Error>
pub fn from_file<T: AsRef<OsStr>>(config: T) -> Result<Config, Error>
Create a new Config from a file.
sourcepub fn with_opts<T: AsRef<OsStr>>(
bin: Option<T>,
config: Option<T>,
root_dir: Option<T>
) -> Result<Config, Error>
pub fn with_opts<T: AsRef<OsStr>>(
bin: Option<T>,
config: Option<T>,
root_dir: Option<T>
) -> Result<Config, Error>
Create a new Config with options.
- bin: The location of the
pacman-conf
binary. Default ispacman-conf
in PATH. - config: Location of config file to parse: Default is pacman’s compiled in default (usually /etc/pacman.conf). root_dir: The RootDir: Default is pacman’s compiled in default (usually /).
sourcepub fn expand_with_opts<T: AsRef<OsStr>>(
bin: Option<T>,
config: Option<T>,
root_dir: Option<T>
) -> Result<String, Error>
pub fn expand_with_opts<T: AsRef<OsStr>>(
bin: Option<T>,
config: Option<T>,
root_dir: Option<T>
) -> Result<String, Error>
Expand the pacman_conf
This generates a pacman.conf with all the Includes expanded
- bin: The location of the
pacman-conf
binary. Default ispacman-conf
in PATH. - config: Location of config file to parse: Default is pacman’s compiled in default (usually /etc/pacman.conf). root_dir: The RootDir: Default is pacman’s compiled in default (usually /).
Trait Implementations
sourceimpl Ini for Config
impl Ini for Config
sourcefn callback(&mut self, cb: Callback<'_>) -> Result<(), Self::Err>
fn callback(&mut self, cb: Callback<'_>) -> Result<(), Self::Err>
The callback function that is called for every line parsed.
sourcefn parse_str(&mut self, ini: &str) -> Result<(), Self::Err>
fn parse_str(&mut self, ini: &str) -> Result<(), Self::Err>
Parses an ini str into a struct. Read more
sourcefn parse(&mut self, filename: Option<&str>, ini: &str) -> Result<(), Self::Err>
fn parse(&mut self, filename: Option<&str>, ini: &str) -> Result<(), Self::Err>
Parses an ini str into a struct. Optionally a filename can be supplied, this is passed to the callback so that error messages can contain the filename. Read more
sourceimpl PartialOrd<Config> for Config
impl PartialOrd<Config> for Config
sourcefn partial_cmp(&self, other: &Config) -> Option<Ordering>
fn partial_cmp(&self, other: &Config) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl StructuralPartialEq for Config
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more