pub struct Configuration<T> { /* private fields */ }
Expand description

A Configuration represents a set of configuration values, initially loaded from disk, and which can be persisted back to disk e.g. just before the application exits. Generally it is expected that only one instance per Identifier is needed globally, and the other functions in this module are intended to provide an easy singleton interface for this class.

Implementations

Initialize a new Configuration with the given identifier, default set of configuration values, and custom disk persistence path (optional). An error might occur if determining the persistence path to use fails, or if deserializing the previously persisted configuration (if any) fails.

Return this instance’s current set of configuration values.

Replace all existing configuration values with the given entirely new set of configuration values.

Reset all of this instance’s configuration values back to their default values (specified previously on construction).

Persist this instance’s current configuration values to disk, so they can be re-loaded on the next construction.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.