Struct ssh::SessionBuilder
source · pub struct SessionBuilder { /* private fields */ }
Implementations§
source§impl SessionBuilder
impl SessionBuilder
pub fn new() -> Self
pub fn disable_default() -> Self
sourcepub fn timeout(self, timeout: Option<Duration>) -> Self
pub fn timeout(self, timeout: Option<Duration>) -> Self
Read/Write timeout for local SSH mode. Use None to disable timeout. This is a global timeout only take effect after the session is established
Use connect_with_timeout
instead if you want to add timeout
when connect to the target SSH server
pub fn username(self, username: &str) -> Self
pub fn password(self, password: &str) -> Self
pub fn private_key<K>(self, private_key: K) -> Selfwhere
K: ToString,
pub fn private_key_path<P>(self, key_path: P) -> Self
pub fn add_kex_algorithms(self, alg: Kex) -> Self
pub fn del_kex_algorithms(self, alg: Kex) -> Self
pub fn add_pubkey_algorithms(self, alg: PubKey) -> Self
pub fn del_pubkey_algorithms(self, alg: PubKey) -> Self
pub fn add_enc_algorithms(self, alg: Enc) -> Self
pub fn del_enc_algorithms(self, alg: Enc) -> Self
pub fn add_mac_algortihms(self, alg: Mac) -> Self
pub fn del_mac_algortihms(self, alg: Mac) -> Self
pub fn add_compress_algorithms(self, alg: Compress) -> Self
pub fn del_compress_algorithms(self, alg: Compress) -> Self
sourcepub fn connect<A>(self, addr: A) -> SshResult<SessionConnector<TcpStream>>where
A: ToSocketAddrs,
pub fn connect<A>(self, addr: A) -> SshResult<SessionConnector<TcpStream>>where
A: ToSocketAddrs,
Create a TCP connection to the target server
sourcepub fn connect_with_timeout<A>(
self,
addr: A,
timeout: Option<Duration>
) -> SshResult<SessionConnector<TcpStream>>where
A: ToSocketAddrs,
pub fn connect_with_timeout<A>(
self,
addr: A,
timeout: Option<Duration>
) -> SshResult<SessionConnector<TcpStream>>where
A: ToSocketAddrs,
Create a TCP connection to the target server, with timeout provided
sourcepub fn connect_bio<S>(self, stream: S) -> SshResult<SessionConnector<S>>
pub fn connect_bio<S>(self, stream: S) -> SshResult<SessionConnector<S>>
connect to target server w/ a bio object
which requires to implement std::io::{Read, Write}
Trait Implementations§
source§impl Default for SessionBuilder
impl Default for SessionBuilder
source§fn default() -> SessionBuilder
fn default() -> SessionBuilder
Returns the “default value” for a type. Read more
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more