snapdir_stores/lib.rs
1//! snapdir stores library.
2//!
3//! Storage backends for snapdir snapshots plus the store-routing and
4//! external-store shim that implement snapdir's store dispatch:
5//!
6//! - [`FileStore`] — the in-process `file://` backend.
7//! - [`S3Store`] — the native AWS-SDK `s3://` backend (ring rustls).
8//! - [`B2Store`] — the native AWS-SDK `b2://` backend, pointed at Backblaze
9//! B2's S3-compatible endpoint (wraps [`S3Store`] with a custom endpoint).
10//! - [`GcsStore`] — the native `google-cloud-storage` `gs://` backend
11//! (ring rustls; ADC credential chain).
12//! - [`router`] — scheme → adapter resolution, including the hardcoded
13//! `gs://`→`gcs` special case for the Google Cloud Storage adapter.
14//! - [`shim`] ([`ExternalStore`]) — the emit-command shim that dispatches
15//! third-party `snapdir-<name>-store` binaries via the documented
16//! `get-manifest-command` / `get-fetch-files-command` / `get-push-command`
17//! contract.
18//! - [`transfer`] ([`TransferConfig`], [`RateLimiter`], [`run_concurrent`]) —
19//! the concurrency + bandwidth-limiting foundation each store carries via a
20//! [`TransferConfig`] for the (later) concurrent transfer loops.
21//! - [`stream`] ([`StreamStore`]) — object/manifest-level, content-addressed,
22//! verified read/write primitives (the foundation for store-to-store sync),
23//! implemented for [`FileStore`], [`S3Store`], [`GcsStore`], and [`B2Store`].
24//! - [`sync`] ([`sync_snapshot`], [`SyncReport`]) — streaming store-to-store
25//! snapshot copy: walks a source manifest and copies its raw objects
26//! source → dest through memory only (no local filesystem staging),
27//! parallelized across a rayon pool and throttled by a
28//! [`BlockingRateLimiter`](transfer::BlockingRateLimiter); writes the manifest
29//! last (all-or-nothing).
30
31pub mod b2_store;
32pub(crate) mod fetch;
33pub mod file_store;
34pub mod gcs_store;
35pub(crate) mod push;
36pub mod router;
37pub mod s3_store;
38pub mod shim;
39pub mod stream;
40pub mod sync;
41pub mod transfer;
42pub(crate) mod util;
43
44pub use b2_store::B2Store;
45pub use file_store::FileStore;
46pub use gcs_store::{GcsLocation, GcsStore};
47pub use router::{resolve_adapter, Adapter, RouteError};
48pub use s3_store::{S3Location, S3Store};
49pub use shim::ExternalStore;
50pub use stream::StreamStore;
51pub use sync::{sync_snapshot, SyncReport};
52pub use transfer::{run_concurrent, BlockingRateLimiter, RateLimiter, TransferConfig};