{"repo":"kkharji/redis-derive","free":true,"listed":false,"github":"https://github.com/kkharji/redis-derive","clone":"git clone https://github.com/kkharji/redis-derive.git","description":"This crate implements the FromRedisValue and ToRedisArgs Traits from mitsuhiko / redis-rs for any struct","language":"Rust","stars":23,"topics":["redis","rust","rust-proc-macro","serde","serde-redis","crates"],"license":"MIT","category":"databases-storage","readme_excerpt":"redis-derive redis-derive This crate implements the FromRedisValue (redis::FromRedisValue) and ToRedisArgs (redis::ToRedisArgs) traits from redis-rs (https://github.com/redis-rs/redis-rs) for any struct or enum. This allows seamless type conversion between Rust structs and Redis hash sets, which is more beneficial than JSON encoding the struct and storing the result in a Redis key because when saving as a Redis hash set, sorting algorithms can be performed without having to move data out of the database. There is also the benefit of being able to retrieve just one value of the struct in the database. Initial development was done by @Michaelvanstraten 🙏🏽. Features - RESP3 Support : Native support for Redis 7+ protocol features including VerbatimString - Hash Field Expiration : Per-field TTL support using Redis 7.4+ HEXPIRE commands - Client-Side Caching : Automatic cache management with Redis 6+ client caching - Cluster Awareness : Hash tag generation for Redis Cluster deployments - Flexible Naming : Support for various case conversion rules (snake case, kebab-case, etc.) - Comprehensive Error Handling : Clear error messages for debugging - Performance Optimized : Efficient serialization with minimal allocations Usage and Examples Add this to your Cargo.toml : Import the procedural macros: Basic Struct Example Enum with Case Conversion Naming Conventions and Attributes Case Conversion Rules The rename all attribute supports multiple case conversion rules: Supported case conv","default_branch":null,"files":null,"tree":[],"storefront":"/r/kkharji","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/kkharji/redis-derive/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}