pub struct HostConfig {
pub hostname: String,
pub user: String,
pub port: Option<u16>,
pub identity_file: Option<String>,
pub jump_host: Option<String>,
pub groups: Vec<String>,
pub description: Option<String>,
}Expand description
Configuration for a remote host
Fields§
§hostname: StringSSH hostname or IP address
user: StringSSH username (default: current user from whoami)
port: Option<u16>SSH port (default: 22)
identity_file: Option<String>Path to SSH identity file (private key)
jump_host: Option<String>Jump host for ProxyJump (user@host:port format)
groups: Vec<String>Organization groups/tags for this host
description: Option<String>Optional description
Implementations§
Source§impl HostConfig
impl HostConfig
Sourcepub fn with_identity_file(self, path: impl Into<String>) -> Self
pub fn with_identity_file(self, path: impl Into<String>) -> Self
Builder pattern: set identity file
Sourcepub fn with_jump_host(self, jump: impl Into<String>) -> Self
pub fn with_jump_host(self, jump: impl Into<String>) -> Self
Builder pattern: set jump host
Sourcepub fn with_group(self, group: impl Into<String>) -> Self
pub fn with_group(self, group: impl Into<String>) -> Self
Builder pattern: add group
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Builder pattern: set description
Sourcepub fn ssh_args(&self) -> Vec<String>
pub fn ssh_args(&self) -> Vec<String>
Get SSH command arguments for this host
Returns arguments for port, identity file, jump host, and target (user@hostname). Does NOT include standard options like BatchMode or ConnectTimeout.
Sourcepub fn format_ssh_command(&self) -> String
pub fn format_ssh_command(&self) -> String
Format the effective SSH command for display
Returns a human-readable SSH command string showing how the connection will be made, useful for debugging and user feedback.
Trait Implementations§
Source§impl Clone for HostConfig
impl Clone for HostConfig
Source§fn clone(&self) -> HostConfig
fn clone(&self) -> HostConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostConfig
impl Debug for HostConfig
Source§impl Default for HostConfig
impl Default for HostConfig
Source§impl<'de> Deserialize<'de> for HostConfig
impl<'de> Deserialize<'de> for HostConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HostConfig
impl PartialEq for HostConfig
Source§impl Serialize for HostConfig
impl Serialize for HostConfig
impl StructuralPartialEq for HostConfig
Auto Trait Implementations§
impl Freeze for HostConfig
impl RefUnwindSafe for HostConfig
impl Send for HostConfig
impl Sync for HostConfig
impl Unpin for HostConfig
impl UnwindSafe for HostConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request