pub struct Ssh { /* private fields */ }Expand description
Represents an ssh2 client.
Implementations§
Source§impl Ssh
impl Ssh
Sourcepub fn connect(host: impl AsRef<str>, opts: SshOpts) -> Result<Self>
pub fn connect(host: impl AsRef<str>, opts: SshOpts) -> Result<Self>
Connect to a remote TCP server using SSH.
pub fn is_authenticated(&self) -> bool
Sourcepub async fn authenticate(&mut self, handler: impl SshAuthHandler) -> Result<()>
pub async fn authenticate(&mut self, handler: impl SshAuthHandler) -> Result<()>
Authenticates the Ssh if not already authenticated.
Sourcepub async fn detect_family(&self) -> Result<SshFamily>
pub async fn detect_family(&self) -> Result<SshFamily>
Detects the family of operating system on the remote machine.
Caches the result such that subsequent checks will return the same family.
Sourcepub async fn launch_and_connect(
self,
opts: DistantLaunchOpts,
) -> Result<DistantClient>
pub async fn launch_and_connect( self, opts: DistantLaunchOpts, ) -> Result<DistantClient>
Consume Ssh and produce a DistantClient that is connected to a remote
distant server that is spawned using the ssh client
Sourcepub async fn launch(
self,
opts: DistantLaunchOpts,
) -> Result<DistantSingleKeyCredentials>
pub async fn launch( self, opts: DistantLaunchOpts, ) -> Result<DistantSingleKeyCredentials>
Consume Ssh and launch a distant server, returning a DistantSingleKeyCredentials
tied to the launched server that includes credentials
Sourcepub async fn into_distant_client(self) -> Result<DistantClient>
pub async fn into_distant_client(self) -> Result<DistantClient>
Consume Ssh and produce a DistantClient that is powered by an ssh client
underneath.
Sourcepub async fn into_distant_pair(self) -> Result<(DistantClient, ServerRef)>
pub async fn into_distant_pair(self) -> Result<(DistantClient, ServerRef)>
Consumes Ssh and produces a DistantClient and ServerRef pair.
Auto Trait Implementations§
impl !Freeze for Ssh
impl !RefUnwindSafe for Ssh
impl Send for Ssh
impl Sync for Ssh
impl Unpin for Ssh
impl !UnwindSafe for Ssh
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