Struct spirit::Builder[][src]

pub struct Builder<O = Empty, C = Empty> { /* fields omitted */ }
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.

Implementations

Sets the inner config loader.

Instead of configuring the configuration loading on the spirit Builder, the inner config loader Builder can be set directly.

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

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

Configures a config dir filter for multiple extensions. Read more

Sets the config dir filter for all the supported extensions. Read more

The command line options structure tied to this instance. Read more

The configuration structure. Read more

The Ok variant used when returning a result. Read more

Has the application already started? 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

Adds a callback executed once the Spirit decides to terminate. Read more

Apply an Extension. 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 body run by the run into this closure. Read more

Wrap the hooks inside the provided closure. Read more

Applies the first Extension of the same type. Read more

Keeps a guard object until destruction. Read more

Specifies if and when the background thread should be joined automatically. Read more

Finish building the Spirit. Read more

Build the spirit and run the application, handling all relevant errors. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Turns self into the result.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.