Struct async_ssh::Session [] [src]

pub struct Session<S: AsyncRead + AsyncWrite>(_);

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.

Methods

impl<S: AsyncRead + AsyncWrite + Tcp + 'static> Session<S>
[src]

[src]

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.

[src]

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.

[src]

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].

Trait Implementations

Auto Trait Implementations

impl<S> !Send for Session<S>

impl<S> !Sync for Session<S>