sorccu / r2d2-redis

MIT License
101 stars 42 forks source link

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

Closed KabDeveloper closed 5 years ago

KabDeveloper commented 5 years ago

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 ?

badboy commented 5 years ago

It's just hincr.

KabDeveloper commented 5 years ago

@badboy Thank you sir :)