pub struct Config { /* private fields */ }
Expand description

A context for resolving configuration values. Holds a combination of environment and token expansion state, as well as the set of configs that should be consulted.

Implementations

Create a new context without any config files loaded

Assign a fake environment map, useful for testing. The environment is used to expand certain values from the config.

Assigns token names and expansions for use with a number of options. The names and expansions are specified by man 5 ssh_config

Assign the value for an option. This is logically equivalent to the user specifying command line options to override config values. These values take precedence over any values found in config files.

Parse config_string as if it were the contents of an ssh_config file, and add that to the list of configs.

Open path, read its contents and parse it as an ssh_config file, adding that to the list of configs

Convenience method for adding the ~/.ssh/config and system-wide /etc/ssh/config files to the list of configs

Resolve the configuration for a given host. The returned map will expand environment and tokens for options where that is specified. Note that in some configurations, the config should be parsed once to resolve the main configuration, and then based on some options (such as CanonicalHostname), the tokens should be updated and the config parsed a second time in order for value expansion to have the same results as ssh.

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

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.

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)

Uses borrowed data to replace owned data, usually by cloning. 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.