Struct zcfg::ConfigInitializer [] [src]

pub struct ConfigInitializer { /* fields omitted */ }

An initialization object that can statically set config objects.

Opaquely enqueuing these objects into a global queue allows config resolution crates to parse out configuration without knowing the entire set of transitive dependencies.

You will find an initializer available in the declared config module, named "INITIALIZER". For the purpose of testing, prefer to access the config value directly (named "CONFIG"), and invoke .set_for_testing directly. For general application initialization, prefer a global config intializer invoked in main.

Methods

impl ConfigInitializer
[src]

[src]

Constructs a new initializer from known initializer reference.

This function is public to allow access by define_cfg macros.

[src]

[src]

[src]

[src]

[src]

[src]

Attempts to parse the config from a string and load it into the associated Config value.

Global initializers use this function after loading global configuration from some source, typically command line arguments or a config file, to populate Config values.