Struct async_ssh::Session

source ·
pub struct Session<S: AsyncRead + AsyncWrite>(_);
Expand description

An established and authenticated SSH session.

You can use this session to execute commands on the remote host using Session::open_exec. This will give you back a [Channel], which can be used to read from the resulting process’ STDOUT, or to write the the process’ STDIN.

Implementations§

Establish a new SSH session on top of the given stream.

The resulting SSH session is initially unauthenticated (see NewSession), and must be authenticated before it becomes useful.

Note that the reactor behind the given handle must continue to be driven for any channels created from this Session to work.

Retrieve the last error encountered during this session.

Note that it is unlikely you will be able to use any items associated with this session once it has returned an error.

Calling this method clears the error.

Establish a new channel over this session to execute the given command.

Note that any errors encountered while operating on the channel after it has been opened will manifest only as reads or writes no longer succeeding. To get the underlying error, call Session::last_error.

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.