pub struct SshPool { /* private fields */ }Expand description
Connection pool for managing multiple SSH connections.
Implementations§
Source§impl SshPool
impl SshPool
Sourcepub fn new(options: SshOptions) -> Self
pub fn new(options: SshOptions) -> Self
Create a new connection pool.
Sourcepub async fn get_or_connect(
&self,
config: &WorkerConfig,
) -> Result<Arc<RwLock<SshClient>>>
pub async fn get_or_connect( &self, config: &WorkerConfig, ) -> Result<Arc<RwLock<SshClient>>>
Get or create a connection to a worker.
Sourcepub async fn active_connections(&self) -> usize
pub async fn active_connections(&self) -> usize
Get the number of active connections.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SshPool
impl !RefUnwindSafe for SshPool
impl Send for SshPool
impl Sync for SshPool
impl Unpin for SshPool
impl UnsafeUnpin for SshPool
impl !UnwindSafe for SshPool
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