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(Arc<PgPool>),
}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(Arc<PgPool>)
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.
Implementations§
Source§impl ManagedConnection
impl ManagedConnection
pub fn kind(&self) -> ProtocolKind
Auto Trait Implementations§
impl Freeze for ManagedConnection
impl !RefUnwindSafe for ManagedConnection
impl Send for ManagedConnection
impl Sync for ManagedConnection
impl Unpin for ManagedConnection
impl UnsafeUnpin for ManagedConnection
impl !UnwindSafe 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