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§

source§

impl Config

source

pub fn options() -> Options

Creates a new empty Options instance. This allows you to change parsing options prior to parsing the config file.

source§

impl Config

source

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.

source

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.

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Config

Returns the “default value” for a type. Read more
source§

impl FromStr for Config

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for Config

source§

fn eq(&self, other: &Config) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Config

source§

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 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.