mod builder;
mod execute;
mod sync_ops;
pub use builder::SdkImplBuilder;
use std::sync::{Arc, Mutex as StdMutex};
use crate::application::topology_scanner::TopologyScanner;
use crate::application::topology_store::TopologyStore;
use crate::application::transfer_engine::TransferEngine;
use crate::domain::config::SyncConfig;
use crate::infra::backend::ProgressFn;
use crate::infra::location::Location;
use crate::infra::location_file_store::LocationFileStore;
use crate::infra::topology_file_store::TopologyFileStore;
use crate::infra::transfer_store::TransferStore;
pub struct SdkImpl {
pub(super) scanner: TopologyScanner,
pub(super) topology: TopologyStore,
pub(super) engine: TransferEngine,
pub(super) topology_files: Arc<dyn TopologyFileStore>,
pub(super) location_files: Arc<dyn LocationFileStore>,
pub(super) transfer_store: Arc<dyn TransferStore>,
pub(super) locations: Vec<Arc<dyn Location>>,
pub(super) config: SyncConfig,
pub(super) scan_excludes: Vec<glob::Pattern>,
pub(super) progress: StdMutex<Option<ProgressFn>>,
}
impl SdkImpl {
pub(super) fn report_progress(&self, msg: &str) {
if let Ok(guard) = self.progress.lock() {
if let Some(cb) = guard.as_ref() {
cb(msg);
}
}
}
}