Struct spirit::Builder [−][src]
Expand description
The builder of Spirit
.
This is returned by the Spirit::new
.
Interface
Most of the methods are available through the following traits. You want to bring them into
scope (possibly by use spirit::prelude::*
) and look at their methods.
ConfigBuilder
to specify how configuration should be loaded.Extensible
to register callbacks.SpiritBuilder
to turn the builder intoSpirit
.
Implementations
Inject command options instead of parsing the real ones.
Useful for example when writing tests and “starting” the application with fake command lines.
Trait Implementations
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
Specifies the default configuration. 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
A callback that is run after the building started and the command line is parsed, but even
before the first configuration is loaded. The configuration provided is either the one
provided to the builder, or a default one when called on the builder, but current
configuration when run on Spirit
. Read more
Adds another config validator to the chain. Read more
Adds a callback able to mutate the configuration while being loaded. Read more
Adds a callback for notification about new configurations. Read more
Adds a callback for reacting to a signal. Read more
Check if this is the first call with the given type. Read more
Add a closure run before the main body. Read more
Wrap the hooks inside the provided closure. Read more
Keeps a guard object until destruction. Read more
Specifies if and when the background thread should be joined automatically. Read more