pub struct Config {
    pub units: UnitSet,
    pub targets: TargetSet,
    pub log: LogConfig,
    pub http: Server,
}
Expand description

The complete RTRTR configuration.

All configuration is available via public fields.

The associated function init should be called first thing as it initializes the operational environment such as logging. Thereafter, config_args can be used to configure a clap app to be able to pick up the path to the configuration file. from_arg_matches will then load the file referenced in the command line and, upon success, return the config.

Fields

units: UnitSet

The set of configured units.

targets: TargetSet

The set of configured targets.

log: LogConfig

The logging configuration.

http: Server

The HTTP server configuration.

Implementations

Initialises everything.

This function should be called first thing.

Creates a configuration from a bytes slice with TOML data.

Configures a clap app with the arguments to load the configuration.

Loads the configuration based on command line options provided.

The matches must be the result of getting argument matches from a clap app previously configured with config_args. Otherwise, the function is likely to panic.

The current path needs to be provided to be able to deal with relative paths. The manager is necessary to resolve links given in the configuration.

Trait Implementations

Deserialize this value from the given Serde deserializer. 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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more