[][src]Struct openssh::SessionBuilder

pub struct SessionBuilder { /* fields omitted */ }

Build a Session with options.

Implementations

impl SessionBuilder[src]

pub fn user(&mut self, user: String) -> &mut Self[src]

Set the ssh user (ssh -l).

Defaults to None.

pub fn port(&mut self, port: u16) -> &mut Self[src]

Set the port to connect on (ssh -p).

Defaults to None.

pub fn keyfile(&mut self, p: impl AsRef<Path>) -> &mut Self[src]

Set the keyfile to use (ssh -i).

Defaults to None.

pub fn known_hosts_check(&mut self, k: KnownHosts) -> &mut Self[src]

See KnownHosts.

Default KnownHosts::Add.

pub fn connect_timeout(&mut self, d: Duration) -> &mut Self[src]

Set the connection timeout (ssh -o ConnectTimeout).

This value is specified in seconds. Any sub-second duration remainder will be ignored. Defaults to None.

pub fn server_alive_interval(&mut self, d: Duration) -> &mut Self[src]

Set the timeout interval after which if no data has been received from the server, ssh will request a response from the server (ssh -o ServerAliveInterval).

This value is specified in seconds. Any sub-second duration remainder will be ignored. Defaults to None.

pub fn control_directory(&mut self, p: impl AsRef<Path>) -> &mut Self[src]

Set the directory in which the temporary directory containing the control socket will be created.

If not set, ./ will be used (the current directory).

pub async fn connect<S: AsRef<str>, '_>(
    &'_ self,
    destination: S
) -> Result<Session, Error>
[src]

Connect to the host at the given host over SSH.

The format of destination is the same as the destination argument to ssh. It may be specified as either [user@]hostname or a URI of the form ssh://[user@]hostname[:port]. A username or port that is specified in the connection string overrides the one set in the builder (but does not change the builder).

If connecting requires interactive authentication based on STDIN (such as reading a password), the connection will fail. Consider setting up keypair-based authentication instead.

Trait Implementations

impl Clone for SessionBuilder[src]

impl Debug for SessionBuilder[src]

impl Default for SessionBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,