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. IfNone, 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. IfNone, 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. IfNone, 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. IfNone, 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
impl Clone for ResolvedConnectionParams
Source§fn clone(&self) -> ResolvedConnectionParams
fn clone(&self) -> ResolvedConnectionParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvedConnectionParams
impl Debug for ResolvedConnectionParams
Source§impl PartialEq for ResolvedConnectionParams
impl PartialEq for ResolvedConnectionParams
Source§fn eq(&self, other: &ResolvedConnectionParams) -> bool
fn eq(&self, other: &ResolvedConnectionParams) -> bool
self and other values to be equal, and is used by ==.