Skip to main content

Crate hashtree_s3

Crate hashtree_s3 

Source
Expand description

S3-backed storage for hashtree with non-blocking uploads.

This crate provides an S3 storage backend that:

  • Stores data locally first (fast writes)
  • Syncs to S3 in the background (non-blocking)
  • Falls back to S3 if data not in local cache

§Example

use hashtree_s3::{S3Store, S3Config};
use hashtree_core::store::MemoryStore;
use std::sync::Arc;

let local_store = Arc::new(MemoryStore::new());
let config = S3Config {
    bucket: "my-bucket".to_string(),
    prefix: Some("blobs/".to_string()),
    region: None, // Uses AWS_REGION env var
    endpoint: None, // For S3-compatible services
};

let s3_store = S3Store::new(local_store, config).await?;

Structs§

S3Config
S3 configuration
S3Store
S3-backed store with local caching and background sync.

Enums§

S3StoreError
S3 store specific errors