Struct cargo::util::config::ConfigKey[][src]

pub struct ConfigKey { /* fields omitted */ }
Expand description

Key for a configuration variable.

This type represents a configuration variable that we’re looking up in Cargo’s configuration. This structure simultaneously keeps track of a corresponding environment variable name as well as a TOML config name. The intention here is that this is built up and torn down over time efficiently, avoiding clones and such as possible.

Implementations

Creates a new blank configuration key which is ready to get built up by using push and push_sensitive.

Creates a ConfigKey from the key specified.

The key specified is expected to be a period-separated toml configuration key.

Pushes a new sub-key on this ConfigKey. This sub-key should be equivalent to accessing a sub-table in TOML.

Note that this considers name to be case-insensitive, meaning that the corrseponding toml key is appended with this name as-is and the corresponding env key is appended with name after transforming it to uppercase characters.

Performs the same function as push except that the corresponding environment variable does not get the uppercase letters of name but instead name is pushed raw onto the corresponding environment variable.

Rewinds this ConfigKey back to the state it was at before the last push method being called.

Returns the corresponding environment variable key for this configuration value.

Returns whether or not this is a key for the root table.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. 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

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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.