pub enum JumpHostConfig {
SshConfigHostRef {
ssh_config_host: String,
},
Detailed {
host: String,
user: Option<String>,
port: Option<u16>,
ssh_key: Option<String>,
},
Simple(String),
}Expand description
Jump host configuration format.
Supports multiple formats:
- Legacy string format:
"[user@]hostname[:port]" - SSH config reference:
"@alias"(references ~/.ssh/config Host alias) - Structured format with optional ssh_key
- Structured SSH config reference with ssh_config_host field
Uses #[serde(untagged)] to allow seamless deserialization of all formats.
Variants§
SshConfigHostRef
Structured SSH config reference format with ssh_config_host field Must be listed first for serde to try matching object format before string
Detailed
Structured format with optional ssh_key field
Simple(String)
Legacy string format: “[user@]hostname[:port]” Also supports SSH config reference with “@” prefix: “@alias”
Implementations§
Source§impl JumpHostConfig
impl JumpHostConfig
Sourcepub fn to_connection_string(&self) -> String
pub fn to_connection_string(&self) -> String
Convert to a connection string for resolution.
Note: For SSH config references (@alias or ssh_config_host), this returns
the alias name with “@” prefix. The actual resolution to hostname/user/port
must be done by the caller using SSH config parsing.
Sourcepub fn is_ssh_config_ref(&self) -> bool
pub fn is_ssh_config_ref(&self) -> bool
Check if this is an SSH config reference (either @alias string or ssh_config_host field)
Sourcepub fn ssh_config_host(&self) -> Option<&str>
pub fn ssh_config_host(&self) -> Option<&str>
Get the SSH config host alias if this is an SSH config reference.
Returns the alias name (without “@” prefix) for:
JumpHostConfig::Simple("@alias")-> Some(“alias”)JumpHostConfig::SshConfigHostRef { ssh_config_host: "alias" }-> Some(“alias”)- Other variants -> None
Trait Implementations§
Source§impl Clone for JumpHostConfig
impl Clone for JumpHostConfig
Source§fn clone(&self) -> JumpHostConfig
fn clone(&self) -> JumpHostConfig
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 JumpHostConfig
impl Debug for JumpHostConfig
Source§impl<'de> Deserialize<'de> for JumpHostConfig
impl<'de> Deserialize<'de> for JumpHostConfig
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>,
Auto Trait Implementations§
impl Freeze for JumpHostConfig
impl RefUnwindSafe for JumpHostConfig
impl Send for JumpHostConfig
impl Sync for JumpHostConfig
impl Unpin for JumpHostConfig
impl UnsafeUnpin for JumpHostConfig
impl UnwindSafe for JumpHostConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
T in a tonic::Request