use std::sync::Arc; use nxmesh_proto::ConfigUpdate; use tracing::info; use crate::connector::master::MasterConnector; #[async_trait::async_trait] pub trait MasterHandler { async fn on_config_update( &self, config_info: ConfigUpdate, ) -> Result<(), Box>; } pub struct MasterHandlerImpl { settings: Arc, } impl MasterHandlerImpl { pub fn new(settings: impl Into>) -> Self { Self { settings: settings.into(), } } } #[async_trait::async_trait] impl MasterHandler for MasterHandlerImpl { async fn on_config_update( &self, config_info: ConfigUpdate, ) -> Result<(), Box> { info!("Received config update from master: {:?}", config_info); Ok(()) } }