use std::sync::Arc; use tokio::sync::Mutex; pub mod ssh; pub type AgentClient = nxmesh_proto::agent_service_client::AgentServiceClient; #[async_trait::async_trait] pub trait MasterConnectorTrait: Send + Sync { async fn connect( &mut self, settings: &crate::config::settings::Settings, ) -> Result<(), Box>; fn get_client(&self) -> Arc>; } pub struct MasterConnector { connector: Box, } impl MasterConnector { pub fn new(connector: Box) -> Self { Self { connector } } } #[async_trait::async_trait] impl MasterConnectorTrait for MasterConnector { async fn connect( &mut self, settings: &crate::config::settings::Settings, ) -> Result<(), Box> { self.connector.connect(settings).await } fn get_client(&self) -> Arc> { self.connector.get_client() } }