Struct thrussh::client::Connection

source ·
pub struct Connection<R: AsyncRead + AsyncWrite, H: Handler> { /* private fields */ }
Expand description

Client connection. A connection implements Future, returning () when it finishes (for instance if the client and server agree to close the connection).

Implementations

Ask the server to close a channel, finishing any pending write and read.

Gets a borrow to the connection’s handler.

Gets a mutable borrow to the connection’s handler.

Tests whether a channel is open.

Create a new client connection.

Send data to a channel. On session channels, extended can be used to encode standard error by passing Some(1), and stdout by passing None.

Try to authenticate this client using a password.

Try to authenticate this client using a key pair.

Try to authenticate this client using a key pair.

Ask the server to open a session channel.

Ask the server to open an X11 forwarding channel.

Ask the server to open a direct TCP/IP forwarding channel.

Wait until a condition is met on the connection.

Flush the session, sending any pending message.

Methods from Deref<Target = Session>

Flush the temporary cleartext buffer into the encryption buffer. This does not flush to the socket.

Retrieves the configuration of this session.

Retrieves the current user.

Sends a disconnect message.

Whether the client is authenticated.

Whether the client is disconnected.

Check whether a channel has been confirmed.

Tests whether we need an authentication method (for instance if the last attempt failed).

Returns the set of authentication methods that can continue, or None if this is not valid.

Request a session channel (the most basic type of channel). This function returns Some(..) immediately if the connection is authenticated, but the channel only becomes usable when it’s confirmed by the server, as indicated by the confirmed field of the corresponding Channel.

Request an X11 channel, on which the X11 protocol may be tunneled.

Open a TCP/IP forwarding channel. This is usually done when a connection comes to a locally forwarded TCP/IP port. See RFC4254. The TCP/IP packets can then be tunneled through the channel using .data().

Send EOF to a channel

Request a pseudo-terminal with the given characteristics.

Request X11 forwarding through an already opened X11 channel. See RFC4254 for security issues related to cookies.

Set a remote environment variable.

Request a remote shell.

Execute a remote program (will be passed to a shell). This can be used to implement scp (by calling a remote scp and tunneling to its standard input).

Signal a remote process.

Request the start of a subsystem with the given name.

Inform the server that our window size has changed.

Request the forwarding of a remote port to the client. The server will then open forwarding channels (which cause the client to call .channel_open_forwarded_tcpip()).

Cancel a previous forwarding request.

Send data to a channel. The number of bytes added to the “sending pipeline” (to be processed by the event loop) is returned.

Trait Implementations

The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
The type of value that this future will resolved with if it is successful. Read more
The type of error that this future will resolve with if it fails in a normal fashion. Read more
Query this future to see if its value has become available, registering interest if it is not. Read more
Block the current thread until this future is resolved. Read more
Map this future’s result to a different type, returning a new future of the resulting type. Read more
Map this future’s error to a different error, returning a new future. Read more
Map this future’s error to any error implementing From for this future’s Error, returning a new future. Read more
Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more
Execute another future after this one has resolved successfully. Read more
Execute another future if this one resolves with an error. Read more
Waits for either one of two futures to complete. Read more
Waits for either one of two differently-typed futures to complete. Read more
Joins the result of two futures, waiting for them both to complete. Read more
Same as join, but with more futures.
Same as join, but with more futures.
Same as join, but with more futures.
Convert this future into a single element stream. Read more
Fuse a future such that poll will never again be called once it has completed. Read more
Do something with the item of a future, passing it on. Read more
Create a cloneable handle to this future where all handles will resolve to the same result. Read more

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.

Creates a new future which allows self until timeout. Read more

Calls U::from(self).

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

The future that this type can be converted into.
The item that the future may resolve with.
The error that the future may resolve with.
Consumes this object and produces a future.
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.