pub async fn resolve(
ssh_dir: &Path,
host: &str,
user: Option<&str>,
) -> Result<ResolvedHost>Expand description
Fully resolve config for a given host alias.
This performs:
- Loading and parsing the main config file.
- Inlining
Includedirectives (with cycle detection). - Token and environment variable expansion.
- First-match-wins resolution with
IdentityFileaccumulation. - If
CanonicalizeHostnameis enabled, a second resolution pass using the resolvedHostNameas the lookup key.
user is the remote username for Match user criteria. When None,
the local username is used (matching OpenSSH behaviour when no -l
flag is given).
ยงErrors
Returns Error::ConfigIncludeCycle if an Include chain contains a
cycle. Returns Error::Io if the config file cannot be read.