Skip to main content

vdsl_sync/
lib.rs

1//! vdsl-sync — N-location file synchronization engine.
2//!
3//! Topology-centric model: TopologyFile (identity) + LocationFile (per-location state)
4//! + RouteGraph (DAG) による分散ファイルストレージの同期エンジン。
5//!
6//! # Architecture
7//!
8//! - **Domain** — core entities ([`TopologyFile`], [`LocationFile`], [`Transfer`], [`LocationId`])
9//! - **Application** — use-case orchestration ([`SdkImpl`], [`TopologyStore`], [`TopologyScanner`])
10//! - **Infrastructure** — persistence and transfer ([`TransferStore`], [`StorageBackend`])
11
12pub(crate) mod application;
13pub(crate) mod domain;
14pub(crate) mod infra;
15
16// Re-exports: SDK public API face
17//
18// Interface layers (MCP, Lua) depend only on these re-exported types.
19// Internal modules are pub(crate) — external crates cannot access via module paths.
20
21// --- SDK trait + result types ---
22pub use application::error::SyncError;
23pub use application::sdk::{
24    PutReport, SyncReport, SyncReportConflict, SyncReportError, SyncStoreSdk,
25};
26pub use application::sdk_impl::{SdkImpl, SdkImplBuilder};
27pub use application::task::{TaskId, TaskStatus};
28pub use application::topology_store::TopologyFileView;
29
30// --- Domain types used in SDK method signatures ---
31pub use domain::file_type::FileType;
32pub use domain::fingerprint::{FileFingerprint, FingerprintPrecision};
33pub use domain::location::{LocationId, LocationSummary, SyncSummary};
34pub use domain::view::{ErrorEntry, PendingEntry, PresenceState, PresenceView};
35
36// --- Builder boundary types (SdkImplBuilder construction) ---
37pub use infra::backend::{ProgressFn, StorageBackend};
38pub use infra::error::InfraError;
39pub use infra::hasher::{ContentHasher, Djb2Hasher, HashResult};
40pub use infra::location::{CloudLocation, LocalLocation, Location, SshLocation};
41pub use infra::location_file_store::LocationFileStore;
42pub use infra::rclone::RcloneBackend;
43pub use infra::shell::{FileInspection, RemoteShell, ShellOutput};
44pub use infra::sqlite::SqliteSyncStore;
45pub use infra::topology_file_store::TopologyFileStore;
46pub use infra::transfer_store::TransferStore;