pub struct SshClient { /* private fields */ }Expand description
SSH client for a single worker connection.
Implementations§
Source§impl SshClient
impl SshClient
Sourcepub fn new(config: WorkerConfig, options: SshOptions) -> Self
pub fn new(config: WorkerConfig, options: SshOptions) -> Self
Create a new SSH client for a worker.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if connected to the worker.
Sourcepub async fn disconnect(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
Disconnect from the worker.
Sourcepub async fn execute(&self, command: &str) -> Result<CommandResult>
pub async fn execute(&self, command: &str) -> Result<CommandResult>
Execute a command on the remote worker.
Sourcepub async fn execute_streaming<F, G>(
&self,
command: &str,
on_stdout: F,
on_stderr: G,
) -> Result<CommandResult>
pub async fn execute_streaming<F, G>( &self, command: &str, on_stdout: F, on_stderr: G, ) -> Result<CommandResult>
Execute a command and stream output in real-time.
Sourcepub async fn health_check(&self) -> Result<bool>
pub async fn health_check(&self) -> Result<bool>
Check if the worker is reachable via SSH.
Auto Trait Implementations§
impl Freeze for SshClient
impl RefUnwindSafe for SshClient
impl Send for SshClient
impl Sync for SshClient
impl Unpin for SshClient
impl UnsafeUnpin for SshClient
impl UnwindSafe for SshClient
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