pub struct SshConnectionManager { /* private fields */ }Expand description
SSH connection pool manager.
Manages a cache of SSH connections with automatic reconnection and connection pooling. Connections are cached for 5 minutes of inactivity.
Implementations§
Source§impl SshConnectionManager
impl SshConnectionManager
Sourcepub async fn get(
&self,
user: String,
addr: String,
port: u16,
password: String,
enable_password: Option<String>,
handler: DeviceHandler,
) -> Result<Sender<CmdJob>, ConnectError>
pub async fn get( &self, user: String, addr: String, port: u16, password: String, enable_password: Option<String>, handler: DeviceHandler, ) -> Result<Sender<CmdJob>, ConnectError>
Gets a cached SSH client or creates a new one.
This method first checks the cache for an existing healthy connection. If found and the connection parameters match, it reuses the connection. Otherwise, it creates a new connection, caches it, and returns the sender.
Sourcepub async fn get_with_security(
&self,
user: String,
addr: String,
port: u16,
password: String,
enable_password: Option<String>,
handler: DeviceHandler,
security_options: ConnectionSecurityOptions,
) -> Result<Sender<CmdJob>, ConnectError>
pub async fn get_with_security( &self, user: String, addr: String, port: u16, password: String, enable_password: Option<String>, handler: DeviceHandler, security_options: ConnectionSecurityOptions, ) -> Result<Sender<CmdJob>, ConnectError>
Gets a cached SSH client or creates a new one with explicit security options.
Trait Implementations§
Source§impl Clone for SshConnectionManager
impl Clone for SshConnectionManager
Source§fn clone(&self) -> SshConnectionManager
fn clone(&self) -> SshConnectionManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SshConnectionManager
impl !RefUnwindSafe for SshConnectionManager
impl Send for SshConnectionManager
impl Sync for SshConnectionManager
impl Unpin for SshConnectionManager
impl !UnwindSafe for SshConnectionManager
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