Struct confget::defs::Config [−][src]
pub struct Config {Show 14 fields
pub backend: BackendKind,
pub filename: Option<String>,
pub list_all: bool,
pub match_regex: bool,
pub match_var_names: bool,
pub match_var_values: Option<String>,
pub name_prefix: String,
pub name_suffix: String,
pub section: String,
pub section_override: bool,
pub section_specified: bool,
pub shell_escape: bool,
pub show_var_name: bool,
pub varnames: Vec<String>,
}
Expand description
Configuration settings for the confget
functions.
This is the main way to control the behavior of a backend’s read_file method, the read_ini_file function, and the format::filter_vars function: specify what file to read, what variables to extract from it, and how to format them.
Fields
backend: BackendKind
The configuration backend to use.
filename: Option<String>
The (backend-specific) filename to read data from.
list_all: bool
Formatting: select all the variables in the specified section.
match_regex: bool
Formatting: treat the variable match patterns as regular expressions instead of glob ones.
match_var_names: bool
Formatting: treat varnames
as a list of patterns, not exact
variable names.
match_var_values: Option<String>
Formatting: only select variables with values that match a pattern.
name_prefix: String
Formatting: specify a string to prepend to the variable name.
name_suffix: String
Formatting: specify a string to append to the variable name.
section: String
Formatting: select variables from the specified section.
section_override: bool
Formatting: read variables from the initial section (“”), then
override their values with variables from the one specified by
the section
field.
section_specified: bool
Formatting: if section
is an empty string and there are no
variables in the initial section, do not select the first section
defined in the file.
shell_escape: bool
Formatting: make the output values suitable for parsing by Bourne-like shells.
show_var_name: bool
Formatting: always display the variable name.
varnames: Vec<String>
Formatting: select variable names or patterns to display.
Implementations
A deprecated alias for Config::default()
.