[−][src]Struct openssh::SessionBuilder
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]
&'_ self,
destination: S
) -> Result<Session, Error>
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]
fn clone(&self) -> SessionBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SessionBuilder
[src]
impl Default for SessionBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for SessionBuilder
impl Send for SessionBuilder
impl Sync for SessionBuilder
impl Unpin for SessionBuilder
impl UnwindSafe for SessionBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,