pub enum ManagedConnection {
Ssh(Arc<RwLock<SshClient>>),
Sftp(Arc<RwLock<StandaloneSftpClient>>),
Ftp(Arc<RwLock<FtpClient>>),
Desktop {
kind: ProtocolKind,
client: Arc<RwLock<Box<dyn DesktopProtocol>>>,
},
Postgres {
pool: Arc<PgPool>,
tunnel: Option<Arc<SshTunnel>>,
},
}Expand description
A single managed connection, tagged by protocol.
Each variant owns its own Arc<RwLock<_>> — giving per-connection locking
granularity, instead of a global map-level RwLock that would serialise
every operation across unrelated connections.
Variants§
Ssh(Arc<RwLock<SshClient>>)
Sftp(Arc<RwLock<StandaloneSftpClient>>)
Ftp(Arc<RwLock<FtpClient>>)
Desktop
Postgres
PgPool is internally Sync (manages its own locks), so no
outer RwLock is needed here — multiple sessions / tabs can
hit the pool concurrently from independent tasks. tunnel holds
the SSH local-forward open for the pool’s lifetime when the
profile connects through one; the pool itself dials its local
port and is unaware of SSH.
Implementations§
Source§impl ManagedConnection
impl ManagedConnection
pub fn kind(&self) -> ProtocolKind
Auto Trait Implementations§
impl !RefUnwindSafe for ManagedConnection
impl !UnwindSafe for ManagedConnection
impl Freeze for ManagedConnection
impl Send for ManagedConnection
impl Sync for ManagedConnection
impl Unpin for ManagedConnection
impl UnsafeUnpin for ManagedConnection
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