Actix storage is a simple wrapper around some key-value storages to provide basic operations without knowing the backend in advance.
Install
Actix-storage is meant to be used alongside one the implementor crates, ex:
# Cargo.toml
[]
= "0.1"
= "0.1"
Usage
After you picked an implementor:
use ;
use HashMapActor;
use ;
async
And later in your handlers
async
Implementations
actix-storage-hashmap
actix-storage-dashmap
actix-storage-sled
actix-storage-redis
Why?
It can be usefull when:
- You don't know what kind of storage you'll want.
- You can't afford the long time compilation of some dbs while developing
- hashmap store compiles pretty fast
- You're writing a general purpose library and you want to let the user decide
Why not?
If you really care about every drop of your application performance then actix-storage may not be for you, as it uses dynamic dispatching internally.
Examples
There are bunch of examples in the examples folder, very basic ones thought, but it will give you the idea.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.