TSOT (That Storage Over There) is a versatile, high-performance storage abstraction library for Rust, designed to provide a unified interface across multiple storage backends.
- 🔌 Pluggable Backends: Seamlessly switch between different storage systems
- 🚀 Multi-Type Support: Store strings, raw bytes, and atomic integers
- ⏰ Flexible Expiration: Time-based item expiration
- 🔀 Async & Sync: First-class support for both asynchronous and synchronous code
- 🔒 Thread-Safe: Concurrent access without compromising performance
Add to your Cargo.toml
:
[dependencies]
tsot = "0.1.0"
# Optional: Enable specific backends
tsot = { version = "0.1.0", features = ["imc", "async"] }
use tsot::{Storage, StorageResult};
// Generic storage interface
let storage = Storage::new_imc();
// Store and retrieve
storage.store_string("key", "value")?;
let value = storage.load_string("key")?;
use tsot::AsyncStorage;
async fn example() {
let storage = AsyncStorage::new_imc();
storage.store_raw("bytes_key", vec![1, 2, 3]).await?;
}
Backend | Status | Async | Sync |
---|---|---|---|
In-Memory | ✅ Stable | ✅ | ✅ |
Redis | ✅ | ❌ | |
Memcached | 🚧 Planned | ✅ | ✅ |
RocksDB | 🚧 Planned | ✅ | ✅ |
Performance is a key priority. Detailed benchmarks coming soon!
- In-Memory Backend
- Redis Backend
- Memcached Backend
- Performance Benchmarking
- Persistent Storage Support
Contributions are welcome! Please see CONTRIBUTING.md for details.
- Fork the repository
- Create a feature branch
- Implement your backend or feature
- Write tests
- Submit a pull request
Licensed under MIT License. See LICENSE for more details.
Built with ❤️ using Rust's powerful type system and concurrency primitives.