use std::sync::Arc; use sea_orm::DatabaseConnection; use tonic::transport::Server; pub mod ssh; #[async_trait::async_trait] pub trait AgentConnectorTrait: Send + Sync { async fn start_server( &mut self, settings: &crate::config::settings::Settings, cert_service: Arc, connection: DatabaseConnection, ) -> Result<(), Box>; } pub struct AgentConnector { connector: Box, } impl AgentConnector { pub fn new(connector: Box) -> Self { Self { connector } } } #[async_trait::async_trait] impl AgentConnectorTrait for AgentConnector { async fn start_server( &mut self, settings: &crate::config::settings::Settings, cert_service: Arc, connection: DatabaseConnection, ) -> Result<(), Box> { self.connector .start_server(settings, cert_service, connection) .await } }