vdsl_sync/application/sdk_impl/
mod.rs1mod builder;
26mod execute;
27mod sync_ops;
28
29pub use builder::SdkImplBuilder;
30
31use std::sync::{Arc, Mutex as StdMutex};
32
33use crate::application::topology_scanner::TopologyScanner;
34use crate::application::topology_store::TopologyStore;
35use crate::application::transfer_engine::TransferEngine;
36use crate::domain::config::SyncConfig;
37use crate::infra::backend::ProgressFn;
38use crate::infra::location::Location;
39use crate::infra::location_file_store::LocationFileStore;
40use crate::infra::topology_file_store::TopologyFileStore;
41use crate::infra::transfer_store::TransferStore;
42
43pub struct SdkImpl {
48 pub(super) scanner: TopologyScanner,
49 pub(super) topology: TopologyStore,
50 pub(super) engine: TransferEngine,
51 pub(super) topology_files: Arc<dyn TopologyFileStore>,
52 pub(super) location_files: Arc<dyn LocationFileStore>,
53 pub(super) transfer_store: Arc<dyn TransferStore>,
54 pub(super) locations: Vec<Arc<dyn Location>>,
55 pub(super) config: SyncConfig,
56 pub(super) scan_excludes: Vec<glob::Pattern>,
57 pub(super) progress: StdMutex<Option<ProgressFn>>,
59}
60
61impl SdkImpl {
62 pub(super) fn report_progress(&self, msg: &str) {
64 if let Ok(guard) = self.progress.lock() {
65 if let Some(cb) = guard.as_ref() {
66 cb(msg);
67 }
68 }
69 }
70}