Struct wezterm_ssh::Config[][src]

pub struct Config { /* fields omitted */ }

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

impl Config[src]

pub fn new() -> Self[src]

Create a new context without any config files loaded

pub fn assign_environment(&mut self, env: ConfigMap)[src]

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

pub fn assign_tokens(&mut self, tokens: ConfigMap)[src]

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

pub fn set_option<K: AsRef<str>, V: AsRef<str>>(&mut self, key: K, value: V)[src]

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.

pub fn add_config_string(&mut self, config_string: &str)[src]

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

pub fn add_config_file<P: AsRef<Path>>(&mut self, path: P)[src]

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

pub fn add_default_config_files(&mut self)[src]

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

pub fn for_host<H: AsRef<str>>(&self, host: H) -> ConfigMap[src]

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

impl Clone for Config[src]

impl Debug for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.