Struct spirit::cfg_loader::Builder [−][src]
pub struct Builder { /* fields omitted */ }
Expand description
A builder for the Loader
.
See the module documentation for details about the use.
Implementations
Turns the builder into the Loader
.
This parses the command line options ‒ the ones specified by the type parameter, enriched by options related to configuration (paths to config files and config overrides).
This returns the parsed options and the loader.
If the command line parsing fails, the application terminates (and prints relevant help).
Turns this into the Loader
, without command line parsing.
It is similar to build
, but doesn’t parse the command line, therefore
only the config_default_paths
are used to
find the config files.
This is likely useful for tests.
Turns this into the Loader
, and command line is parsed from the provided iterator.
Similar to the build
, this returns the options and the loader. However,
the options is loaded from the provided iterator and error is explicitly returned. This
makes it better match for tests, but can be useful in other circumstances too.
Note that the 0th argument is considered to be the name of the application and is not parsed as an option.
Trait Implementations
Specifies the default configuration. Read more
fn config_default_paths<P, I>(self, paths: I) -> Self where
I: IntoIterator<Item = P>,
P: Into<PathBuf>,
fn config_default_paths<P, I>(self, paths: I) -> Self where
I: IntoIterator<Item = P>,
P: Into<PathBuf>,
Sets the configuration paths in case the user doesn’t provide any. Read more
Enables loading configuration from environment variables. Read more
Sets a configuration dir filter. Read more
Sets if warning should be produced for each unused configuration key. Read more
Specifies the default configuration as typed value. Read more
Configures a config dir filter for a single extension. Read more
fn config_exts<I, E>(self, exts: I) -> Self where
I: IntoIterator<Item = E>,
E: Into<OsString>,
fn config_exts<I, E>(self, exts: I) -> Self where
I: IntoIterator<Item = E>,
E: Into<OsString>,
Configures a config dir filter for multiple extensions. Read more
Sets the config dir filter for all the supported extensions. Read more