pub struct SshTunnel { /* private fields */ }Expand description
SSH tunnel to a remote Docker daemon
The tunnel forwards a local port to the remote Docker socket. Implements Drop to ensure the SSH process is killed on cleanup.
Implementations§
Source§impl SshTunnel
impl SshTunnel
Sourcepub fn new(host: &HostConfig, host_name: &str) -> Result<Self, HostError>
pub fn new(host: &HostConfig, host_name: &str) -> Result<Self, HostError>
Create SSH tunnel to remote Docker socket
Spawns an SSH process with local port forwarding:
ssh -L local_port:/var/run/docker.sock -N host
Uses BatchMode=yes to fail fast if key not in agent.
Sourcepub fn local_port(&self) -> u16
pub fn local_port(&self) -> u16
Get the local port for Docker connection
Sourcepub fn docker_url(&self) -> String
pub fn docker_url(&self) -> String
Get the Docker connection URL
Sourcepub async fn wait_ready(&self) -> Result<(), HostError>
pub async fn wait_ready(&self) -> Result<(), HostError>
Wait for tunnel to be ready (port accepting connections)
Retries with exponential backoff: 100ms, 200ms, 400ms (3 attempts)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SshTunnel
impl RefUnwindSafe for SshTunnel
impl Send for SshTunnel
impl Sync for SshTunnel
impl Unpin for SshTunnel
impl UnwindSafe for SshTunnel
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> 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