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 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§fn clone(&self) -> SshTransport
fn clone(&self) -> SshTransport
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 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,
Read the full contents of a file at
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,
Write
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,
List entries in a directory at
path.Source§fn create_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_dir_all<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a directory and all parents.
Source§fn exec_shell<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
cwd: &'life2 Path,
env: &'life3 [(String, String)],
timeout: Duration,
max_output_bytes: usize,
) -> Pin<Box<dyn Future<Output = Result<ExecResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn exec_shell<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
cwd: &'life2 Path,
env: &'life3 [(String, String)],
timeout: Duration,
max_output_bytes: usize,
) -> Pin<Box<dyn Future<Output = Result<ExecResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute a shell command in the given working directory with optional
environment variables, timeout, and max output bytes.
Auto Trait Implementations§
impl Freeze for SshTransport
impl RefUnwindSafe for SshTransport
impl Send for SshTransport
impl Sync for SshTransport
impl Unpin for SshTransport
impl UnsafeUnpin for SshTransport
impl UnwindSafe for SshTransport
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