sorccu/r2d2-redis

no method named `hincrby` found for type `r2d2::PooledConnection<r2d2_redis::RedisConnectionManager>` in the current scope

KabDeveloper opened this issue · 2 comments

Hi,

It seem that HINCRBY is not reconized using this crate !

Here is what I did, first create a pool:


//Redis Pool
let rmanager = RedisConnectionManager::new("redis://127.0.0.1:6379").unwrap();
let pool = r2d2::Pool::builder()
   .build(rmanager)
   .unwrap();

Then use it inside a function like this:

let mut connection = pool.get().unwrap();

And finally, I wanted to use the command HINCRBY like this:

connection.hincrby::<String, String, String>("the_key".to_string(), "value_to_incr".to_string(), "1".to_string());

But infortunatelly getting this error message:

no method named `hincrby` found for type `r2d2::PooledConnection<r2d2_redis::RedisConnectionManager>` in the current scope

When using INCR command, it is working well, but I need to use HINCRBY for hash.

Can you tell me where is the problem with it please ?

It's just hincr.

@badboy Thank you sir :)