| Crates.io | objstore_fs |
| lib.rs | objstore_fs |
| version | 0.1.0-alpha.1 |
| created_at | 2026-01-24 05:46:01.645227+00 |
| updated_at | 2026-01-24 05:46:01.645227+00 |
| description | Filesystem backend for objstore |
| homepage | |
| repository | https://github.com/theduke/objstore |
| max_upload_size | |
| id | 2066276 |
| size | 47,371 |
Generic object store (S3, Google Cloud Storage, ...) abstraction library for Rust
Provides an ObjStore trait, and multiple different implementations,
allowing to easily write flexible code that does not depend on a specific
object store, and allows for easy testing with an in-memory store.
Each backend is available as a separate crate.
objstore_memory
In-memory store, useful for testing and small applications.
objstore_fs
Filesystem-backed store.
Stores metadata such as hashes as a separate file.
objstore_s3_light
Lightweight S3 backend based on rusty-s3 and reqwest.
Not as full-featured as objstore_s3, which uses the official AWS SDK,
but has way fewer dependencies.
objstore_s3
Full-featured S3 backend based on the official AWS SDK.
Supports more functionality efficiently, but has more dependencies.
objstore_gcs
Google Cloud Storage backend based on the official GCP SDK.
NOTE: not implemented yet, but planned.
use objstore::{ObjStoreBuilder, ObjStoreExt};
#[tokio::main]
async fn main() {
let builder = ObjStoreBuilder::new()
.with_provider(Box::new(objstore_memory::MemoryProvider))
.with_provider(Box::new(objstore_fs::FsProvider))
.with_provider(Box::new(objstore_s3_light::S3LightProvider));
// let uri = "memory://";
// let uri = "fs:///tmp/my_store";
let uri = "s3://ACCESS_KEY:SECRET_KEY@domain.com/bucket-name?style=path";
let store = builder
.build(uri)
.expect("Failed to create object store from URI");
store.put("hello.txt").text("hello world").await.unwrap();
let content = store
.get("hello.txt")
.await
.expect("failed to get object")
.expect("object not found");
assert_eq!(content.as_ref(), b"hello world");
store.delete("hello.txt").await.unwrap();
}
The objstore_test crate provides a common test helper objstore_test::test_objstore,
which ensures all backends conform to the same behaviour.
Licensed under either of