Struct zcfg::Config [] [src]

pub struct Config<T: Clone> { /* fields omitted */ }

A configurable element in the associated module

Methods

impl<T: Clone> Config<T>
[src]

[src]

Constructs a new config object for the known static initializer retrieval methods.

This is public by necessity for access by the declare_cfg macros.

[src]

[src]

[src]

[src]

[src]

Fetch the current value for this config from global state.

It may or may not be initialized.

To increase testability you should limit retrieval of config values to some dependency resolution area of your code, rather than within business logic.

[src]

Sets the value of this config directly for testing.

Concurrent tests that invoke this method will probably be flakey. Prefer to set this in a std::sync::ONCE block, and verify that it has been called.

[src]

Resets the value of this config back to its default directly for testing.

Concurrent tests that invoke this method will probably be flakey. Prefer to set this in a std::sync::ONCE block, and verify that it has been called.