pub struct SshTransport { /* private fields */ }Expand description
Implementations§
Source§impl SshTransport
impl SshTransport
Sourcepub fn new(
host: impl Into<String>,
remote_workspace: impl Into<PathBuf>,
) -> Self
pub fn new( host: impl Into<String>, remote_workspace: impl Into<PathBuf>, ) -> Self
Create a new SSH transport.
host is in user@host or user@host:port format.
remote_workspace is the absolute path to the workspace on the remote machine.
Sourcepub fn with_key(self, key_path: impl Into<PathBuf>) -> Self
pub fn with_key(self, key_path: impl Into<PathBuf>) -> Self
Set the path to an SSH private key.
Sourcepub fn with_connect_timeout(self, timeout: Duration) -> Self
pub fn with_connect_timeout(self, timeout: Duration) -> Self
Set the SSH connect timeout.
Sourcepub fn with_command_timeout(self, timeout: Duration) -> Self
pub fn with_command_timeout(self, timeout: Duration) -> Self
Set the SSH command timeout.
Sourcepub fn with_insecure_host_key_checking(self, on: bool) -> Self
pub fn with_insecure_host_key_checking(self, on: bool) -> Self
Opt in to skipping host-key verification (MITM-unsafe).
Emits a tracing::warn! so the choice is visible in logs.
When enabled, commands are built with StrictHostKeyChecking=accept-new
(first-use trust): the remote host key is accepted on first connection
but later changes are still detected. This is strictly better than
StrictHostKeyChecking=no but is still unsafe against an active MITM
on the very first connection — only use it for trusted networks or
disposable sandboxes. Default is false (secure).
Sourcepub fn remote_workspace(&self) -> &Path
pub fn remote_workspace(&self) -> &Path
Return the remote workspace path.
Trait Implementations§
Source§impl Clone for SshTransport
impl Clone for SshTransport
Source§impl Debug for SshTransport
impl Debug for SshTransport
Source§impl ToolTransport for SshTransport
impl ToolTransport for SshTransport
Source§fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
path.Source§fn write_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
contents: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 Path,
contents: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
contents to a file at path, creating parent directories.Source§fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_dir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<DirEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
path.