[][src]Struct spirit::cfg_loader::Builder

pub struct Builder { /* fields omitted */ }

A builder for the Loader.

See the module documentation for details about the use.

Methods

impl Builder[src]

pub fn new() -> Self[src]

Creates a new config loader builder.

pub fn build<O: StructOpt>(self) -> (O, Loader)[src]

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).

pub fn build_no_opts(self) -> Loader[src]

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.

Trait Implementations

impl ConfigBuilder for Builder[src]

fn config_defaults_typed<C: Serialize>(self, config: &C) -> Result<Self, Error>[src]

Specifies the default configuration as typed value. Read more

fn config_ext<E: Into<OsString>>(self, ext: E) -> Self[src]

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>, 
[src]

Configures a config dir filter for multiple extensions. Read more

impl Default for Builder[src]

Auto Trait Implementations

impl Send for Builder

impl !Sync for Builder

Blanket Implementations

impl<T> IntoResult for T[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T