pub struct SshPool { /* private fields */ }Expand description
SSH connection pool. Maintains persistent SSH connections and opens
channels on demand. Multiple channels share a single TCP+SSH connection
per host. Thread-safe and cheaply cloneable via Arc.
Implementations§
Source§impl SshPool
impl SshPool
pub fn new() -> Self
Sourcepub async fn connect(
&self,
host: &str,
user: Option<&str>,
remote_socket: Option<&str>,
) -> Result<DuplexStream, Error>
pub async fn connect( &self, host: &str, user: Option<&str>, remote_socket: Option<&str>, ) -> Result<DuplexStream, Error>
Open a direct-streamlocal channel to a remote blit-server.
- Resolves
~/.ssh/configfor the target host. - Reuses an existing SSH connection if available.
- Authenticates via ssh-agent, then falls back to key files.
- If
remote_socketisNone, discovers the socket path on the remote. - Auto-starts blit-server on the remote if needed.
- Returns a bidirectional
DuplexStreamconnected to the remote socket.
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