pub struct Config {Show 15 fields
pub backend: BackendKind,
pub encoding: String,
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: BackendKindThe configuration backend to use.
encoding: StringThe encoding the input file is in, or “” for the locale default.
filename: Option<String>The (backend-specific) filename to read data from.
list_all: boolFormatting: select all the variables in the specified section.
match_regex: boolFormatting: treat the variable match patterns as regular expressions instead of glob ones.
match_var_names: boolFormatting: 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: StringFormatting: specify a string to prepend to the variable name.
name_suffix: StringFormatting: specify a string to append to the variable name.
section: StringFormatting: select variables from the specified section.
section_override: boolFormatting: read variables from the initial section (“”), then
override their values with variables from the one specified by
the section field.
section_specified: boolFormatting: 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: boolFormatting: make the output values suitable for parsing by Bourne-like shells.
show_var_name: boolFormatting: always display the variable name.
varnames: Vec<String>Formatting: select variable names or patterns to display.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more