https://github.com/onesignal/serde-redis
Serde support for redis-rs
https://github.com/onesignal/serde-redis
Last synced: 10 months ago
JSON representation
Serde support for redis-rs
- Host: GitHub
- URL: https://github.com/onesignal/serde-redis
- Owner: OneSignal
- License: apache-2.0
- Created: 2016-01-28T03:22:03.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-09-16T19:14:11.000Z (over 1 year ago)
- Last Synced: 2025-04-03T01:16:48.562Z (11 months ago)
- Language: Rust
- Size: 2.02 MB
- Stars: 75
- Watchers: 42
- Forks: 17
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
redis-serde
===========
[](https://travis-ci.org/OneSignal/serde-redis)
[](https://docs.rs/crate/serde-redis/)
[](https://crates.io/crates/serde-redis/)
[serde][] serialization and deserialization of [redis-rs][] values
[serde]: https://github.com/serde-rs/serde
[redis-rs]: https://github.com/mitsuhiko/redis-rs
## Status
- Deserialization: Everything _should_ work.
- Serialization: **unimplemented**
## Summary
This crate gives you automatic deserialization of values returned from redis-rs.
```rust
use serde_redis::RedisDeserialize;
#[derive(Debug, Deserialize, PartialEq)]
struct Simple {
a: String,
b: String,
}
let s: Simple = redis.hgetall("simple_hash")?
.deserialize()?;
```
## Future work
- Work at the redis protocol level instead of `redis::Value` type.
- Merge into redis-rs?
## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.