Struct mz_ssh_util::tunnel_manager::SshTunnelManager
source · pub struct SshTunnelManager {
tunnels: Arc<Mutex<BTreeMap<SshTunnelKey, SshTunnelState>>>,
}
Expand description
Thread-safe manager of SSH tunnel connections.
Fields§
§tunnels: Arc<Mutex<BTreeMap<SshTunnelKey, SshTunnelState>>>
Implementations§
source§impl SshTunnelManager
impl SshTunnelManager
sourcepub async fn connect(
&self,
config: SshTunnelConfig,
remote_host: &str,
remote_port: u16,
timeout_config: SshTimeoutConfig,
in_task: InTask,
) -> Result<ManagedSshTunnelHandle, Error>
pub async fn connect( &self, config: SshTunnelConfig, remote_host: &str, remote_port: u16, timeout_config: SshTimeoutConfig, in_task: InTask, ) -> Result<ManagedSshTunnelHandle, Error>
Establishes an SSH tunnel for the given remote host and port using the
provided tunnel
configuration.
If there is an existing SSH tunnel, a handle to that tunnel is returned, rather than establishing a new tunnel.
The manager guarantees that there will never be more than one in flight connection attempt for the same tunnel, even when this method is called concurrently from multiple threads.
Trait Implementations§
source§impl Clone for SshTunnelManager
impl Clone for SshTunnelManager
source§fn clone(&self) -> SshTunnelManager
fn clone(&self) -> SshTunnelManager
Returns a copy 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 moresource§impl Debug for SshTunnelManager
impl Debug for SshTunnelManager
source§impl Default for SshTunnelManager
impl Default for SshTunnelManager
source§fn default() -> SshTunnelManager
fn default() -> SshTunnelManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SshTunnelManager
impl RefUnwindSafe for SshTunnelManager
impl Send for SshTunnelManager
impl Sync for SshTunnelManager
impl Unpin for SshTunnelManager
impl UnwindSafe for SshTunnelManager
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request