ClientConfig

Struct ClientConfig 

pub struct ClientConfig {
    pub ssh_config_path: String,
    pub program: String,
    pub arguments: Vec<String>,
    pub username_host_placeholder: String,
}
Expand description

Representation of the client subcommand configurations.

Fields§

§ssh_config_path: String

Full path to the SSH config.

§Example

'C:\Users\<username>\.ssh\config'

§program: String

Name of the program used to establish the SSH connection.

§Example

'ssh'

§arguments: Vec<String>

List of arguments provided to the program.

Must include the username_host_placeholder.

§Example

['-XY', '{{USERNAME_AT_HOST}}']

§username_host_placeholder: String

Placeholder string used to inject <user>@<host> into the list of arguments.

§Example

'{{USERNAME_AT_HOST}}'

Trait Implementations§

§

impl Debug for ClientConfig

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Default for ClientConfig

§

fn default() -> Self

Returns a sensible default ClientConfig.

§Returns

ClientConfig with the following values:

  • ssh_config_path - %USERPROFILE%\.ssh\config
  • program - ssh
  • arguments - -XY {{USERNAME_AT_HOST}}
  • usernamt_host_placeholder - {{USERNAME_AT_HOST}}

Note: %USERPROFILE% actually is resolved by us, so the actual value is whatever the environment variable at runtime points to.

§

impl<'de> Deserialize<'de> for ClientConfig

§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl From<ClientConfig> for ClientConfigOpt

§

fn from(val: ClientConfig) -> Self

Wraps all configuration values as options.

§

impl From<ClientConfigOpt> for ClientConfig

§

fn from(val: ClientConfigOpt) -> Self

Unwraps the existing configuration values or applies the default.

§

impl PartialEq for ClientConfig

§

fn eq(&self, other: &ClientConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Serialize for ClientConfig

§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl StructuralPartialEq for ClientConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,