pub struct SshTunnelSpec {
pub name: Option<String>,
pub kind: TunnelKind,
pub local_port: u16,
pub remote_host: Option<String>,
pub remote_port: Option<u16>,
pub host_alias: String,
}Expand description
Description of one SSH tunnel.
Fields§
§name: Option<String>Optional human-friendly name.
kind: TunnelKind§local_port: u16Local port that ssh will bind on localhost.
remote_host: Option<String>Remote target host (only used for Local). For Dynamic, ignored.
remote_port: Option<u16>Remote target port (only used for Local).
host_alias: StringSSH host argument (alias from ~/.ssh/config or user@host).
Implementations§
Source§impl SshTunnelSpec
impl SshTunnelSpec
Sourcepub fn ssh_args(&self) -> Vec<String>
pub fn ssh_args(&self) -> Vec<String>
Build the argument list passed to ssh.
Always includes -N (no remote command). Uses only host_alias
— relies on ~/.ssh/config (or DNS) to resolve it.
Sourcepub fn ssh_args_with(&self, host: &ResolvedHost<'_>) -> Vec<String>
pub fn ssh_args_with(&self, host: &ResolvedHost<'_>) -> Vec<String>
Like [ssh_args] but injects -l user, -p port, -i identity_file
from a resolved host, and uses hostname (when provided) as the
positional target so prt-config-only aliases resolve correctly.
Trait Implementations§
Source§impl Clone for SshTunnelSpec
impl Clone for SshTunnelSpec
Source§fn clone(&self) -> SshTunnelSpec
fn clone(&self) -> SshTunnelSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SshTunnelSpec
impl Debug for SshTunnelSpec
impl Eq for SshTunnelSpec
Source§impl PartialEq for SshTunnelSpec
impl PartialEq for SshTunnelSpec
impl StructuralPartialEq for SshTunnelSpec
Auto Trait Implementations§
impl Freeze for SshTunnelSpec
impl RefUnwindSafe for SshTunnelSpec
impl Send for SshTunnelSpec
impl Sync for SshTunnelSpec
impl Unpin for SshTunnelSpec
impl UnsafeUnpin for SshTunnelSpec
impl UnwindSafe for SshTunnelSpec
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.