Expand description
snapdir stores library.
Storage backends for snapdir snapshots plus the store-routing and external-store shim that implement snapdir’s store dispatch:
FileStore— the in-processfile://backend.S3Store— the native AWS-SDKs3://backend (ring rustls).B2Store— the native AWS-SDKb2://backend, pointed at Backblaze B2’s S3-compatible endpoint (wrapsS3Storewith a custom endpoint).GcsStore— the nativegoogle-cloud-storagegs://backend (ring rustls; ADC credential chain).router— scheme → adapter resolution, including the hardcodedgs://→gcsspecial case for the Google Cloud Storage adapter.shim(ExternalStore) — the emit-command shim that dispatches third-partysnapdir-<name>-storebinaries via the documentedget-manifest-command/get-fetch-files-command/get-push-commandcontract.limits(BackendLimits,for_scheme) — the published per-backend request-rate / bandwidth caps (rate caps only; no retry policy) keyed by storage scheme, used to pace transfers under each provider’s documented limits.transfer(TransferConfig,RateLimiter,run_concurrent) — the concurrency + bandwidth-limiting foundation each store carries via aTransferConfigfor the (later) concurrent transfer loops.retry(RetryPolicy,retry_async,retry_blocking) — a pure, injectable full-jitter exponential-backoff engine (no real clock/sleep of its own; theJittersource andAsyncSleeper/BlockingSleeperare injected). SDK-agnostic over anAttemptoutcome; wiring into the S3/GCS/B2 call sites is a later gate.adaptive(AdaptiveGate,AdaptiveController) — pure, injectable adaptive control: a resizable concurrency permit pool (async + blocking) plus a deterministic slow-start/AIMD controller that turns injected op samples + system metrics into a concurrency limit and target byte-rate (wiring into the live transfer loops is a later gate).stream(StreamStore) — object/manifest-level, content-addressed, verified read/write primitives (the foundation for store-to-store sync), implemented forFileStore,S3Store,GcsStore, andB2Store.pack(write_pack,read_pack,PackSink) — the SNAPPACK 1 wire stream behind thessh://acceleration plumbing (snapdir send-pack | ssh … 'snapdir receive-pack'):objrecords stream through incremental BLAKE3 verification (O(1) memory into aFileSink), the manifest rides last and commits only after theendtrailer, so truncation can never publish a snapshot.sync(sync_snapshot,SyncReport) — streaming store-to-store snapshot copy: walks a source manifest and copies its raw objects source → dest through memory only (no local filesystem staging), parallelized across a rayon pool and throttled by aBlockingRateLimiter; writes the manifest last (all-or-nothing).
Re-exports§
pub use adaptive::p95_object_size;pub use adaptive::AdaptiveController;pub use adaptive::AdaptiveGate;pub use adaptive::AdaptivePolicy;pub use adaptive::ControllerDriver;pub use adaptive::Decision;pub use adaptive::OpResult;pub use adaptive::OpSample;pub use b2_store::B2Store;pub use file_store::FileStore;pub use gcs_store::GcsLocation;pub use gcs_store::GcsStore;pub use limits::for_scheme;pub use limits::BackendLimits;pub use pack::is_hex64;pub use pack::read_pack;pub use pack::write_pack;pub use pack::FileSink;pub use pack::PackReadReport;pub use pack::PackSink;pub use pack::PackWriteReport;pub use pack::StreamSink;pub use pack::MAX_HEADER_BYTES;pub use pack::MAX_MANIFEST_BYTES;pub use pack::WIRE_CAPS;pub use pack::WIRE_MAGIC;pub use pack::WIRE_VERSION;pub use retry::parse_retry_after;pub use retry::retry_async;pub use retry::retry_blocking;pub use retry::retry_network;pub use retry::AsyncSleeper;pub use retry::Attempt;pub use retry::BlockingSleeper;pub use retry::DefaultJitter;pub use retry::FixedJitter;pub use retry::Jitter;pub use retry::RetryPolicy;pub use retry::ThreadSleeper;pub use retry::TokioSleeper;pub use router::resolve_adapter;pub use router::Adapter;pub use router::RouteError;pub use s3_store::S3Location;pub use s3_store::S3Store;pub use shim::ExternalStore;pub use stream::StreamStore;pub use sync::sync_snapshot;pub use sync::SyncReport;pub use transfer::classify_error;pub use transfer::run_adaptive;pub use transfer::run_concurrent;pub use transfer::AdaptivePolicy as TransferAdaptivePolicy;pub use transfer::BlockingRateLimiter;pub use transfer::RateLimiter;pub use transfer::TransferConfig;
Modules§
- adaptive
- Adaptive concurrency + throughput control (pure control logic).
- b2_
store B2Store: theb2://storage backend, backed by Backblaze B2’s S3-compatible endpoint via the native AWS SDK.- file_
store FileStore: thefile://storage backend.- gcs_
store GcsStore: thegs://storage backend, backed by the nativegoogle-cloud-storageSDK.- limits
- Per-backend rate-limit table (RATE CAPS ONLY).
- pack
- SNAPPACK 1 — the snapdir pack wire format.
- retry
- Reusable retry/backoff engine for the network stores.
- router
- Store routing: scheme → adapter / binary-name resolution.
- s3_
store S3Store: thes3://storage backend, backed by the native AWS SDK.- shim
- External-store emit-command shim.
- stream
- Object/manifest-level, content-addressed streaming over a
Store. - sync
- Streaming store-to-store snapshot copy.
- transfer
- Transfer configuration, rate limiting, and bounded-concurrency driver.