Skip to main content

ResolvedConnectionParams

Struct ResolvedConnectionParams 

Source
pub struct ResolvedConnectionParams {
    pub hostname: String,
    pub port: Option<u16>,
    pub username: Option<String>,
    pub password: Option<String>,
    pub platform: Option<String>,
    pub extras: Option<Extras>,
}
Expand description

Fully resolved connection parameters for establishing a connection to a host.

This struct represents the final, merged connection configuration after applying defaults, group settings, host-specific settings, and connection-plugin-name-specific overrides. It contains all the information needed to establish a connection to a target host using a specific connection plugin name (e.g., SSH, NETCONF, HTTP).

The resolution process follows a hierarchical priority order where settings at higher levels (host-specific) override settings at lower levels (defaults). Connection-specific options can override base settings at each hierarchy level.

§Fields

  • hostname - The resolved hostname or IP address for the connection. This field is always present and defaults to an empty string if not specified anywhere in the hierarchy. It represents the target address for the connection.

  • port - Optional port number for the connection. If None, the connection implementation should use its default port. When specified, it indicates the TCP/UDP port to use for establishing the connection.

  • username - Optional username for authentication. If None, the connection may use other authentication methods or fail if credentials are required. When specified, it provides the username for credential-based authentication.

  • password - Optional password for authentication. If None, the connection may use other authentication methods (e.g., SSH keys) or fail if a password is required. When specified, it provides the password for authentication.

  • platform - Optional platform identifier (e.g., “linux”, “cisco_ios”, “junos”). This helps connection implementations apply platform-specific behavior, command syntax, or protocol variations. If None, the connection uses generic behavior.

  • extras - Optional arbitrary JSON data for additional connection-specific configuration. This allows passing custom parameters that don’t fit the standard fields, such as timeout values, retry settings, or protocol-specific options.

§Examples

let params = ResolvedConnectionParams {
    hostname: "10.0.0.1".to_string(),
    port: Some(830),
    username: Some("admin".to_string()),
    password: Some("secret".to_string()),
    platform: Some("junos".to_string()),
    extras: None,
};

assert_eq!(params.hostname, "10.0.0.1");
assert_eq!(params.port, Some(830));

Fields§

§hostname: String§port: Option<u16>§username: Option<String>§password: Option<String>§platform: Option<String>§extras: Option<Extras>

Trait Implementations§

Source§

impl Clone for ResolvedConnectionParams

Source§

fn clone(&self) -> ResolvedConnectionParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResolvedConnectionParams

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ResolvedConnectionParams

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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.
Source§

impl StructuralPartialEq for ResolvedConnectionParams

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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