Response type not string compatible

Hello, I'm using https://crates.io/crates/redis with a redis::aio::ConnectionManager to send a smembers query to my redis server and I'm having difficulty to get the results:

let result = redis::cmd("SMEMBERS").arg(user_id.as_bytes()).query_async::<ConnectionManager, HashSet<String>>(&mut redis).await;
if let Ok(list) = result {
    debug!("{:?}",list);
}

I get a Result<Ok> and the debug! print:

Response was of incompatible type: "Response type not string compatible." (response was bulk(string-data('"gabuzomeu"')))

According to the documentation, it should be able to convert it to a HashSet FromRedisValue in redis - Rust

And there is "some" examples that doing it.

What did I miss?

I don’t know much about redis but it looks kind of like the returned data struct might be a sequence of a sequence of strings (instead of a sequence of strings) based on the message and the crate docs. If you leave the type as a RedisValue and do a debug!, what does it print?

I remove the specified template type and it works perfectly. Thank you. I was stuck here because the Rust extension for visual studio code report a false error because It was unable to infer the type.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.