Note The main branch includes many breaking changes, switch to v0.3 branch for the released version.
Basteh(previously actix-storage) is a type erased wrapper around some key-value storages to provide common operations.
Basteh is meant to be used alongside one the implementer crates, ex:
```toml
[dependencies] basteh = "0.4.0-alpha.2" basteh-memory = "0.4.0-alpha.2" ```
After you picked a backend:
```rust,ignore use basteh::{Storage, Format}; use basteh_memory::MemoryBackend;
async fn makestorage() -> Storage { // Intialize the implementer according to its docs let store = MemoryBackend::startdefault();
// Give it to the Storage struct let storage = Storage::build().store(store).finish();
// Or if it doesn't support expiring functionality // it will give errors if those methods are called let storage = Storage::build().store(store).no_expiry().finish();
// It is also possible to feed a seprate expiry, // as long as it works on the same storage backend let storage = Storage::build().store(store).expiry(expiry).finish();
storage } ```
It can be usefull when:
There are bunch of examples in the examples
folder, very basic ones thought, but it will give you the idea.
This project is licensed under either of
at your option.