Struct spurs::ssh::SshShell

source ·
pub struct SshShell { /* private fields */ }
Expand description

Represents a connection via SSH to a particular source.

Implementations§

Returns a shell connected via the default private key at $HOME/.ssh/id_rsa to the given SSH server as the given user.

SshShell::with_default_key("markm", "myhost:22")?;

Returns a shell connected via private key file key to the given SSH server as the given user.

SshShell::with_key("markm", "myhost:22", "/home/foo/.ssh/id_rsa")?;

Toggles dry run mode. In dry run mode, commands are not executed remotely; we only print what commands we would execute. Note that we do connect remotely, though. This is off by default: we default to actually running the commands.

Attempt to reconnect to the remote until it reconnects (possibly indefinitely).

Run a command on the remote machine, blocking until the command completes.

Note that command using sudo will hang indefinitely if sudo asks for a password.

Run a command on the remote machine, without blocking until the command completes. A handle is returned, which one can join on to wait for process completion.

Note that command using sudo will hang indefinitely if sudo asks for a password.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.