pub struct TunnelManager { /* private fields */ }
Expand description
Manager for multiple tunnel connections with automatic failover
Implementations§
Source§impl TunnelManager
impl TunnelManager
Sourcepub fn with_config(config: TunnelManagerConfig) -> Self
pub fn with_config(config: TunnelManagerConfig) -> Self
Create a new tunnel manager with custom configuration
Sourcepub async fn add_tunnel(&self, tunnel: Box<dyn Tunnel>)
pub async fn add_tunnel(&self, tunnel: Box<dyn Tunnel>)
Add a tunnel implementation to the manager
Sourcepub async fn active_tunnel(&self) -> Option<TunnelProtocol>
pub async fn active_tunnel(&self) -> Option<TunnelProtocol>
Get the currently active tunnel
Sourcepub async fn select_tunnel(
&self,
capabilities: &NetworkCapabilities,
) -> Option<TunnelSelection>
pub async fn select_tunnel( &self, capabilities: &NetworkCapabilities, ) -> Option<TunnelSelection>
Select the best available tunnel based on network capabilities
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect the currently active tunnel
Sourcepub async fn metrics(&self) -> Option<TunnelMetrics>
pub async fn metrics(&self) -> Option<TunnelMetrics>
Get metrics for the currently active tunnel
Sourcepub async fn health_check(&self) -> Result<()>
pub async fn health_check(&self) -> Result<()>
Perform health checks on all tunnels
Sourcepub async fn perform_automatic_failover(&self) -> Result<()>
pub async fn perform_automatic_failover(&self) -> Result<()>
Perform automatic failover to the next best available tunnel
Sourcepub async fn get_tunnel_quality_metrics(&self) -> Vec<TunnelQualityMetric>
pub async fn get_tunnel_quality_metrics(&self) -> Vec<TunnelQualityMetric>
Get tunnel quality metrics for monitoring and selection
Sourcepub async fn start_monitoring(&self) -> Result<()>
pub async fn start_monitoring(&self) -> Result<()>
Start automatic monitoring task for continuous health checks
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TunnelManager
impl !RefUnwindSafe for TunnelManager
impl Send for TunnelManager
impl Sync for TunnelManager
impl Unpin for TunnelManager
impl !UnwindSafe for TunnelManager
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